card = {"S" => Array.new(13,0), "H" => Array.new(13,0), "C" => Array.new(13,0), "D" => Array.new(13,0)}

gets.to_i.times do
  sute, num = gets.split
  card[sute][num.to_i-1] = 1
end

card.each{|(key,value)|
  value.each_with_index{|v,i|
    if v == 0
      puts "#{key} #{i+1}"
    end
  }
}
