marks = ['S', 'H', 'C', 'D']
m = int(input())

cards = []
for _ in range(m):
    cards.append(input())
    
for mark in marks:
    for number in range(1, 14):
        if f'{mark} {number}' not in cards:
            print(f'{mark} {number}')

