n = input()
x = {'S':[], 'H':[], 'C':[], 'D':[]}
for i in range(n):
    a = raw_input().split()
    x[a[0]].append(int(a[1]))
for key in ['S', 'H', 'C', 'D']:
    for i in range(13):
        for j in x[key]:
            if i+1 == j: break
        else: print key, i+1