# coding:utf-8
n = input()
card = []
for i in range(1,14):
    card.append(('S', str(i)))
for i in range(1,14):
    card.append(('H', str(i)))
for i in range(1,14):
    card.append(('C', str(i)))
for i in range(1,14):
    card.append(('D', str(i)))
array = [raw_input().split() for i in range(n)]
src_set = set(card)
array_set = set(map(tuple, array))
answer = sorted(src_set ^ array_set, key=card.index)
for v1,v2 in answer:
    print v1,v2

