cards = []
for pic in ['S', 'H', 'C', 'D']:
    for i in range(1, 14):
        cards.append('%s %d' % (pic, i))

c = int(input())
for i in range(c):
    k = input()
    if k in cards:
        del cards[cards.index(k)]

for card in cards:
    print(card)