n = int(input())
x = input().split()
y = int(x[1])
if x[0] == "S":
  for i in range(13):
    if i == x[1]:
      print("S",i)
if x[0] == "H":
  for j in range(13):
    if j == x[1]:
      print("H",j)
if x[0] == "C":
  for k in range(13):
    if k == x[1]:
      print("C",k) 
if x[0] == "D":
  for l in range(13):
    if l == x[1]:
      print("D",l) 
      
  
  
  
  
