n=int(input())
d={} #空の辞書
for i in range(n):
  cards=input()
  d[cards]=1
print(d)

for c in ['S', 'H', 'C', 'D']:
  for n in range(1,13):
    key=c+' '+str(n)
    if not key in cards:
      print(key)
