# coding: utf-8
# Here your code !

n = input()

A = []
for i in range(n):
    A.append(raw_input().split())
    
s = []
h = []
c = []
d = []  # mark???????????????
for i in range(n):
    if A[i][0] == 'S' :
        s.append(A[i][1])
    elif A[i][0] == 'H':
        h.append(A[i][1])
    elif A[i][0] == 'C':
        c.append(A[i][1])
    elif A[i][0] == 'D':
        d.append(A[i][1])

snumber = []
hnumber = []
cnumber = []
dnumber = []

for i in range(1,14): #1-13?????§?????????
    z = 0
    for j in range(len(s)): #s[]???????????°??????????????°?????????snumber???????´?
        if s[j] == i :
            z = 1
            break
    if z == 0:    
        snumber.append(i)
        
    z = 0
    for j in range(len(h)):
        if h[j] == i :
            z = 1
            break
    if z == 0:
        hnumber.append(i)
        
    z = 0
    for j in range(len(c)):
        if c[j] == i :
            z = 1
            break
    if z == 0:    
        cnumber.append(i)
        
    z = 0    
    for j in range(len(d)):
        if d[j] == i :
            z = 1
            break
    if z == 0:    
        dnumber.append(i)
        
for i in range(len(snumber)):
    print "S",snumber[i]
for i in range(len(hnumber)):
    print "H",hnumber[i]
for i in range(len(cnumber)):
    print "C",cnumber[i]
for i in range(len(dnumber)):
    print "D",dnumber[i]
    
        