n = int(input())
cards = []
for i in range(n):
    s, a = input().split()
    cards.append((s, a))
l = [(s, a) for s in "SHCD" and  a in range(1,14) and (s,a)not in cards]
for b in l:
    print(s + " " + a)