all_cards = [x + " " + str(y) for x in ["S", "H", "C", "D"] for y in range(1, 14)]
N = int(input())
i = 0
while i < N:
    has_card = input()
    if has_card in all_cards:
        all_cards.remove(has_card)
    i += 1
for j in all_cards:
    print(j)

