n = int(input())
for i in range(n):
    k = input().split()
    if k[0] == 'S':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                s = list()
                s.append(i)
                s.sort()
                sl = len(s)
    if k[0] == 'H':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                h = list()
                h.append(i)
                h.sort()
                hl = len(h)
    if k[0] == 'C':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                c = list()
                c.append(i)
                c.sort()
                cl = len(c)
    if k[0] == 'D':
        for i in range(1,14):
            if int(k[1])==i:
                continue
            else:
                d = list()
                d.append(i)
                d.sort()
                dl = len(d)
                
for i in range(1,sl+1):
    print('S {0}'.format(s[i]))
    
for i in range(1,hl+1):
    print('H {0}'.format(h[i]))
 
for i in range(1,dl+1):
    print('D {0}'.format(d[i])) 

for i in range(1,cl+1):
    print('C {0}'.format(c[i]))
