require 'set'
suits = %w(S H C D)
deck = Hash[suits.map {|s| [s, Set[*(1..13).to_a]] }]
n = gets.to_i
n.times do
  s, i = gets.chomp.split
  deck[s].delete(i.to_i)
end
suits.each do |s|
  deck[s].each do |i|
    puts "#{s} #{i}"
  end
end
