#16Bmissing
def mn(li):
    if li[0]== "S":
        c[0]=0
    elif li[0]== "H":
        li[0]=1
    elif li[0]== "C":
        li[0]=2
    elif li[0]== "D":
        li[0]=3
    li[1]=int(li[1])
    return li
def nm(nu):
    if nu==0:
        co="S"
    elif nu==1:
        co="H"
    elif nu==2:
        co="C"
    elif nu==3:
        co="D"
#    co+=??? ???+str(li[1])
    return co
N=int(input())
m=[[]]
for i in range(N-1):
    c=[j for j in input().split()]
    c=mn(c)
    for j in range(2):
        m[i].append(c[j])
    m.append([])
c=[j for j in input().split()]
c=mn(c)
for j in range(2):
    m[N-1].append(c[j])
m.sort()
i=0
j=0
l=1
#print(m)
while i < N:
    while m[i][0]!=j:
        for k in range(1,14):
            print(nm(m[i][0])+" "+str(k))
        j+=1
  #  print(i)
    while m[i][1]!=l:
        print(nm(m[i][0])+" "+str(l))
        l+=1
    l+=1
    if l>13:
        l=1
        j+=1
    i+=1