num = gets.to_i
spades, hearts, clubs, dias = [], [], [], []
card_kinds = {'S' => spades, 'H' => hearts, 'C' => clubs, 'D' => dias}
num.times do
  card = gets.split
  case card[0]
  when "S"
    spades << card[1].to_i
  when "H"
    hearts << card[1].to_i
  when "C"
    clubs << card[1].to_i
  when "D"
    dias << card[1].to_i
  end
end
card_kinds.each do |cards_name, cards_arr|
  (1..13).each do |i|
    if !(cards_arr.include?(i))
      puts "#{cards_name} #{i}"
    end
  end
end
