n=int(raw_input())
cards=[[0 for j in range(13)]for i in range(4)]
for i in range(n):
        c=map(str,raw_input().split())
        if c[0]=="S":
                c[0]=0
        elif c[0]=="H":
                c[0]=1
        elif c[0]=="C":
                c[0]=2
        elif c[0]=="D":
                c[0]=3
        cards[int(c[0])][int(c[1])-1]=1
for i in range(4):
        for j in range(13):
                if cards[i][j] == 0:
                        if i == 0:
                                k=str("S")
                        elif i == 1:
                                k=str("H")
                        elif i == 2:
                                k=str("C")
                        elif i == 3:
                                k=str("D")
                        print k,j+1