alldeck = [f'{mark} {num + 1}' for mark in 'SHCD' for num in range(13)]
count = int(input())
deck = set(input() for _ in range(count))
nokori = set(alldeck) - deck
[print(card) for card in sorted(nokori, key=lambda c: alldeck.index(c))]

