h = Hash.new{ |h, k| h[k] = {} }
n = gets.to_i
for i in 1..n do
  a = gets.split(" ")
  h[a[0]][a[1]] = 1
end
for i in ["S", "H", "C", "D"] do
  for j in 1..13 do
    puts "#{i} #{j}" unless h[i][j.to_s]
  end
end
