data = {
    'S':[int(x) for x in range(1,14)],
    'H':[int(x) for x in range(1,14)],
    'C':[int(x) for x in range(1,14)],
    'D':[int(x) for x in range(1,14)]
     }

n = int(input())
for nc in range(n):
    (s, r) = input().split()
    index = cards[s].index(int(r))
    del cards[s][index]
  
for s in ['S', 'H', 'C', 'D']:
    for r in cards[s]:
        print(s, r)