deck = {S:[0]*13,H:[0]*13,C:[0]*13,D:[0]*13}

n = gets.chomp.to_i
for i in 1..n do
  suit,rank = gets.chomp.split(" ")
  suit = suit.to_sym
  rank = rank.to_i
  deck[suit][rank-1] = 1
end

for s in [:S,:H,:C,:D] do
  for r in 1..13 do
    if deck[s][r-1] == 0
      printf("%s %d\n",s,r)
    end
  end
end
