S = list('0'*13)
H = list('1'*13)
C = list('2'*13)
D = list('3'*13)
card_all = [S,H,C,D]

n = int(input())
for i in range(n):
    card = input().split()
    if card[0] == 'S':
        card_all[0][int(card[1])-1] = int(card[1])
    elif card[0] == 'H':
        card_all[1][int(card[1])-1] = int(card[1])
    elif card[0] == 'C':
        card_all[2][int(card[1])-1] = int(card[1])
    elif card[0] == 'D':
        card_all[3][int(card[1])-1] = int(card[1])
card_a = []
for ??? in card_all:
    s = 0
    for j in ???:
        s+=1
        if j == '0':
            print('S {}'.format(s))
        elif j == '1':
            print('H {}'.format(s))
        elif j == '2':
            print('C {}'.format(s))
        elif j == '3' :
            print('D {}'.format(s))