n = int(input())
a = [] #手持ちのカード
for i in range(n):
    x, y = input().split()
    a.append([x, y])

trump = [] #トランプ全体
for i in range(1,14):
    trump.append(['S', str(i)])
    trump.append(['H', str(i)])
    trump.append(['C', str(i)])
    trump.append(['D', str(i)])

#手持ちを引く #ここがわからん
dif = []
for i in range(len(trump)):
    for j in range(len(a)):
        if trump[i] != a[j]:
            dif.append(trump[i])

for i in range(len(dif)):
    x = dif[i]
    if x[0] == "S":
        print(x[0] +' '+ x[1])
for i in range(len(dif)):
    x = dif[i]
    if x[0] == "H":
        print(x[0] + ' '+ x[1])
for i in range(len(dif)):
    x = dif[i]
    if x[0] == "C":
        print(x[0] + ' '+ x[1])
for i in range(len(dif)):
    x = dif[i]
    if x[0] == "D":
        print(x[0] + ' '+ x[1])
