n=int(input())
d={"S":[],"H":[],"C":[],"D":[]}

for i in range(n):
    m,num=input().split()
    d[m].append(num)

for x in d:
    for i in range(1,14):
        if not str(i) in d[x]:
            print("{} {}".format(x,i))
