cd=[]
suits=['S','H','C','D']
for i in range(int(input())):
    s,n=map(str,input().split())
    cd.append(suits.index(s)*13+int(n)-1)
for i in range(52):
    if not(i in cd):
        print(suits[i//13],i%13+1)
