N = int(input())
cards = []
for i in range(N):
    line = input().split()
    a = line[0]
    num = int(line[1])
    cards.append((a, num))
tarinai_list = []
for a in ['S', 'H', 'C', 'D']:
    for num in range(1, 14):
        for card in cards:
            if a == card[0] and num == card[1]:
                break
        tarinai_list.append((a, num))
for l in tarinai_list:
    print(' '.join(map(str, l)))
