cards = {
         'S': [0 for _ in range(13)],
         'H': [0 for _ in range(13)],
         'C': [0 for _ in range(13)],
         'D': [0 for _ in range(13)],
}

n = int(input())
for _ in range(n) :
    (s, r) = input().split()
    index = cards[s].index(int(r))
    del cards[s][index]

for s in ['S', 'H', 'C', 'D'] :
    for r in cards[s] :
        print(s, r)