n=int(input())
a=[[]]*4
s,h,c,d=[],[],[],[]
for i in range(n)
    m,r=input().split()
    if m == 'S'
        s.append(int(r))
     elif m == 'H'
        s.append(int(r))
     elif m == 'C'
        s.append(int(r))
     elif m == 'D'
        s.append(int(r))
for i in range(1,14):
    if i not in s:
        print('S', str(i))
for i in range(1,14):
    if i not in h:
        print('H', str(i))
for i in range(1,14):
    if i not in c:
        print('C', str(i))
for i in range(1,14):
    if i not in d:
        print('D', str(i))