cards = []
patterns = ['S', 'H', 'C', 'D']

for i in patterns:
    for j in range(1, 14):
        cards.append('{} {}'.format(i, j))

n = int(input())

for _ in range(n):
    card = input()
    cards.remove(card)

for c in cards:
    print(c)
