cardlist = [[i for i in range(1,14)] for j in range(4)]
n=int(input())
for s in range(0,n):
  x,y=(input().split())
  y=int(y)
  if   x =="S":
    cardlist[0].remove(y)
  elif x =="H":
    cardlist[1].remove(y)
  elif x =="C":
    cardlist[2].remove(y)
  else:
    cardlist[3].remove(y)
for i in cardlist[0]:
  print("S",z)
for i in cardlist[1]:
  print("H",z)
for i in cardlist[2]:
  print("C",z)
for i in cardlist[3]:
  print("D",z)
  
  