n = gets.to_i
card = Array.new(13).map{ Hash["S" => true, "H" => true, "C" => true, "D" => true] }

for i in 1..n
  mark, numbur = gets.split(" ")
  card[numbur.to_i - 1][mark] = false
end

for mark in ["S", "H", "C", "D"]
  for numbur in 1..13
    puts "#{mark} #{numbur}" if card[numbur.to_i - 1][mark] == true
  end
end