n=int(input())
d={'S':[0]*13,'H':[0]*13,'C':[0]*13,'D':[0]*13}
for i in range(n):
    suit,rank=input().split()
    d[suit][int(rank)-1]=1
for k,v in d.items():
    for i in range(13):
        if v[i]==0:
            print(k,i+1)

