n = input()
 
S = range(1, 14)
H = range(1, 14)
C = range(1, 14)
D = range(1, 14)
 
for i in range(0, n):
   mk, num = map(int,raw_input()split())
      if mk == 'S':
         S[str(num)-1] = 0
      elif mk == 'H':
         S[str(num)-1] = 0
      elif mk == 'C':
         S[str(num)-1] = 0
      elif mk == 'D':
         S[str(num)-1] = 0
 
for i in S:
   if S[i] != 0:
      print ('S' i+1)

for i in H:
   if S[i] != 0:
      print ('H' i+1)

for i in C:
   if S[i] != 0:
      print ('C' i+1)

for i in D:
   if S[i] != 0:
      print ('D' i+1)