m = ["S","H","C","D"]
n = int(input())

deck = []
for i in range(n):
  mark, num = map(str, input().split())
  deck.append([mark,int(num)])

for check in m:
  for i in range(13):
    if not([check,i+1] in deck) :
      print(check,i+1)
