n = gets.chomp.to_i

suits = "SHCD"
lost_cards = Array.new(4){Array.new(13, true)}
n.times{
    suit, rank = gets.chomp.split
    lost_cards[suits.index(suit)][rank.to_i - 1] = false
}

(0..3).each{|suit_no|
    (0..12).each{|rank|
        puts "#{suits[suit_no]} #{rank + 1}" if lost_cards[suit_no][rank]
    }
}