n = int(input())
spade = hart = club = diamond = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
trump = [spade, hart, club, diamond]
suit_def = ['S', 'H', 'C', 'D']

for i in range(n):
    card = list(input().split())
    suit = card[0]
    number = int(card[1])
    if suit == 'S':
        spade.remove(number)
    elif suit == 'H':
        hart.remove(number)
    elif suit == 'C':
        club.remove(number)
    elif suit == 'D':
        diamond.remove(number)

for i, j in zip(trump, suit_def):
    for k in i:
        print(j, k)