import sys

cards_exist = []
for lineCnt, line in enumerate(sys.stdin):
    if lineCnt == 0: continue
    cards_exist.append(line.rstrip('\n'))

for suit in ('S', 'H', 'C', 'D'):
    for num in range(1, 14):
        card = '%s %d' % (suit, num) 
        if card in cards_exist: continue
        print card