N = int(input())
M = ["S", "H", "C", "D"]

sr = set()
for _ in range(N):
    s, r = input().split()
    sr.add(s+r)
for m in M:
    for i in range(1, 14):
        mi = m+str(i)
        if mi not in sr:
            print(m, i)

