n = gets.to_i
vec = Array.new(4) { Array.new(13) }
suits = %w[S H C D]

n.times do
  suit, rank = gets.split
  suit_index = suits.index(suit)
  vec[suit_index][rank.to_i - 1] = 1
end

vec.each_with_index do |v, i|
  v.each_with_index do |w, j|
    next unless w.nil?

    suit = suits[i]
    rank = j + 1
    puts "#{suit} #{rank}"
  end
end

