

S=[0]*13
H=[0]*13
C=[0]*13
D=0]*13
 
CARD={}
CARD['S']=S
CARD['H']=H
CARD['C']=C
CARD['D']=D
 
n=input()
for_in xrange(n):
    x=raw_input().split()
    (CARD[x[0]])[int(x[1])-1]=1
 
for suit in ['S','H','C','D']:
    for i in xrange(13):
        if(CARD[card])[i]==0:
            print'%s %d'%(card,i+1)