s = ['S', 'H', 'C', 'D']
d = {}
for c in s:
  d[c] = [i for i in range(1, 14)]

n = int(input())
for i in range(n):
  s, j = input().split()
  d[s].remove(int(j))

for s in d:
    for i in d[s]:
        print('{} {}'.format(s, i))
