z = input()
d = {}

L = ['S','H','C','D']
for i in L:
    for j in range(1,14):
        d[i] = d.get(i,[]) + [str(j)]


while 1:
    x = raw_input().split()
    if x[0] == '0':
        break
    else:
        d[x[0]].remove(x[1])


for i in L:
    for j in sorted(d[i]):
        print i + " " + j