a=int(input())
cards = []
for c in ['S', 'H', 'C', 'D']:
  for n in range(1, 14):
    cards.append(f'{c} {n}')

for i in range(a):
    x=input()
    if x in cards:
        cards.remove(x)
for i in range(len(cards)):
    print(cards[i])
