n=input()

S=range(1,14)
H=range(1,14)
C=range(1,14)
D=range(1,14)
 
for i in range(n):
   m, k=raw_input().split()
   if m == 'S':
      S[int(k)-1] = 0
   elif m == 'H':
       H[int(k)-1] = 0
   elif m == 'C':
       C[int(k)-1] = 0
   elif m == 'D':
       D[int(k)-1] = 0

for i in range(0, 13):
   if S[i] != 0:
      print 'S '+str(S[i])

for i in range(0, 13):
   if h[i] != 0:
      print 'H '+str(H[i])

for i in range(0, 13):
   if C[i] != 0:
      print 'C '+str(C[i])

for i in range(0, 13):
   if d[i] != 0:
      print 'D '+str(D[i])