_n = gets
cards = readlines.each_with_object({'S' => [], 'H' => [], 'C' => [], 'D' => []}) do |line, hash|
  suit, rank = line.split
  hash[suit] << rank.to_i
end
rank_array = (1..13).to_a
cards.each do |suit, ranks|
  (rank_array - ranks).each do |rank|
    puts "#{suit} #{rank}"
  end
end