n=int(input())
x={0:'S',1:'H',2:'C',3:'D'}
c=[[0]*13,[0]*13,[0]*13,[0]*13]
for r in range(n):
    a,b=input().split()
    b=int(b)-1
    if a=='S':
        c[0][b]=b
    elif a=='H':
        c[1][b]=b
    elif a=='C':
        c[2][b]=b
    else:
        c[3][b]=b
for i in range(4):
    for j in range(13):
        if c[i][j]==0:
            print(x[i],j+1)
