n = int(input())
lst = {"S":[0]*13, "H":[0]*13, "C":[0]*13, "D":[0]*13} 
for i in range(n):
    x, num = raw_input().split()
    num = int(num)
    lst[x][num-1] = 1
for i in ["S", "H", "C", "D"]:
  for j in range(13):
    if lst[i][j] == 0:
      print i, j+1