n = int(input())
count = 0
T = []
while count != n:
    g, num = input().split()
    T.append(g+num)
    count += 1
for g in 'SHCD':
    for num in range(1,14):
        if g+str(num) not in T:
            print(g, num)
