n = int(input())
card = {
    'S':[False for _ in range(13)],
    'H':[False for _ in range(13)],
    'C':[False for _ in range(13)],
    'D':[False for _ in range(13)]
}
for _ in range(n):
    mark, num = map(int, input().split())
    card[mark][num-1] = True

for mark in "SHCD":
    for num in range(13):
        if card[mark][num] is False:
            print(mark, num+1)

