n = int(input())
cardslist = []

for i in range(n):
    input_cards = input().split()
    cardslist.append(input_cards)

for mark in "SHCD":
    for i in range(1, 14):
        if [mark, str(i)] not in cardslist:
            print(mark + " " + str(i))

