def create_correct_set
  set = []
  %w(S H C D).each do |v|
    1.upto(13) do |i|
      set.push("#{v} #{i}")
    end
  end
  set
end

def func
  n = gets.to_i
  exists_cards = n.times.map{ gets.strip }

  correct_set = create_correct_set

  not_exists_cards = correct_set - exists_cards
  not_exists_cards.each do |c|
    puts c
  end
end

func
