n = int(input())
S = [input().split() for i in range(n)]
S = [''.join(s) for s in S]

for p in ['S','H','C','D']:
    for i in range(1,13+1):
        if p+str(i) not in S:
            print(p+' '+str(i))
