cards = {'S': set(), 'H': set(), 'C': set(), 'D': set()}
n = int(raw_input())
for i in range(n):
    pattern, rank = map(str, raw_input().split())
    cards[pattern].add(int(rank))
result = list(cards['S'].symmetric_difference(set(range(1, 14))))
for i in result:
    print("S " + str(i))
result = list(cards['H'].symmetric_difference(set(range(1, 14))))
for i in result:
    print("H " + str(i))
result = list(cards['C'].symmetric_difference(set(range(1, 14))))
for i in result:
    print("C " + str(i))
result = list(cards['D'].symmetric_difference(set(range(1, 14))))
for i in result:
    print("D " + str(i))