r4 = range(4)
r13 = range(13)
cards = [[0 for i in r13] for j in r4]
while True:
    n = inpur()
    for i in range(n):
        s1, s2 = raw_input().split()
        s1 = 'SHCD'.index(s1)
        s2 = int(s2)-1
        cards[s1][s2] = 1

for j in r4:
    for i in r13:
        if cards[j][i]==0: print 'SHCD'[j],i+1