n = input()

a = [] 
flag = {}
for j in range(1, 14):
    flag[('S',j)] = 0
    flag[('H',j)] = 0
    flag[('C',j)] = 0
    flag[('D',j)] = 0

for i in range(n):
    temp = map(str, raw_input().split())
    a.append((temp[0],temp[1]))
    print a[i][0]
    print a[i][1]
#Sについて
for i in range(n):
    if(a[i][0] == 'S'):
        print 'Yes'
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                print 'Yes'
                flag[('S',j)] = 1
#Hについて
for i in range(n):
    if(a[i][0] == 'H'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('H',j)] = 1
#Cについて
for i in range(n):    
    if(a[i][0] == 'C'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('C',j)] = 1
#Dについて
for i in range(n):    
    if(a[i][0] == 'D'):
        for j in range(1, 14):
            if(int(a[i][1]) == j):
                flag[('D',j)] = 1

for j in range(1, 14):
    if(flag[('S',j)] == 0):
        print 'S' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('H',j)] == 0):
        print 'H' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('C',j)] == 0):
        print 'C' ' ' '%d' %(j)
for j in range(1, 14):
    if(flag[('D',j)] == 0):
        print 'D' ' ' '%d' %(j)
        