cards = {}
%w(S H C D).each do |mark|
     for num in 1..13
        k = "#{mark} #{num}"
        cards[k] = false
    end
end

n = gets.chomp.to_i
n.times do |i|
    card = gets.chomp
    cards[card] = true
end

cards.select!{|k,v|
    puts k unless v
}