# Reversing numbers

# n = int(input())
# l = list(map(int, input().split()))
# print(*reversed(l))

# rel = []
# for i in range(-1, (-1) * (n + 1), -1):
#     rel.append(l[i])
# print(*rel)

# finding Missing Cards

n = int(input())
l = []
card = []
S_list = []
H_list = []
C_list = []
D_list = []
design = ["S", "H", "C", "D"]

for _ in range(n):
    l.append(input())        
    
for x in range(1, 14):
    for y in design:
        card.append(y + " " + str(x))
         
rest = set(card) - set(l)

for i in list(rest):
    if design[0] in i:
        S_list.append(i)
    elif design[1] in i:
        H_list.append(i)
    elif design[2] in i:
        C_list.append(i)
    elif design[3] in i:
        D_list.append(i)
        
print(*sorted(S_list), sep = "\n")
print(*sorted(H_list), sep = "\n")
print(*sorted(C_list), sep = "\n")
print(*sorted(D_list), sep = "\n")