require "set"

table = {
  "S" => Set::new,
  "H" => Set::new,
  "C" => Set::new,
  "D" => Set::new
}

gets.to_i.times do
  suit, num = gets.split(" ")
  num = num.to_i
  table[suit] << num
end

%w(S H C D).each do |suit|
  1.upto(13) do |n|
    puts "#{suit} #{n}" unless table[suit].include?(n)
  end
end