from collections import OrderedDict as od
a = {n for n in range(1,14)}
dic = od({"S":[],"H":[], "C":[], "D":[]})
N = int(input())
for n in range(N):
    card, num = tuple(input().split())
    dic[card].append(int(num))

dic["S"] = list(a - set(dic["S"]))
dic["H"] = list(a - set(dic["H"]))
dic["C"] = list(a - set(dic["C"]))
dic["D"] = list(a - set(dic["D"]))

for card,num in dic.items():
    for n in num:
        print("{0} {1}".format(card,str(n)))
