n = int(input())
S, H, C, D = [], [], [], []

for i in range(n):
    p, num = input().split()
    eval(p).append(int(num))

for i in "SHCD":
    for j in range(1, 14):
        if j not in eval(i):
            print(i, j)

