playing_cards = {
    "S"=>[],
    "H"=>[],
    "C"=>[],
    "D"=>[]
}

num_of_cards = gets.to_i
num_of_cards.times do
    card_info = gets.split
    playing_cards[card_info[0]].push(card_info[1].to_i)
end
["S","H","C","D"].each do |mark|
    (1..13).each do |number|
        if !playing_cards[mark].include?(number)
            puts "#{mark} #{number}"
        end
    end
end
