marks = "SHCD"
cards = { 'S':{}, 'H':{}, 'C':{}, 'D':{} }

N = int(input())

for _ in range(N):
    m, n = input().split()
    cards[m][int(n)] = n

for m in marks:
    for i in range(1, 14):
        if i not in cards[m]:
            print(m, i)

