n=int(input())
S="SHCD"
A=[]
for i in range(4):
    B=[0 for i in range(13)]
    A.append(B)
print(A)
for i in range(n):
    a,b=[j for j in input().split()]
    b=int(b)
    b-=1
    if a=="S":
        a=0
    elif a=="H":
        a=1
    elif a=="C":
        a=2
    else: 
        a=3
    A[a][b]=1
for i in range(4):
    for j in range(13):
        if A[i][j]==0:
            print(S[i],end=" ")
            print(j+1)
