counts = gets.to_i
cards = Array.new(4){Array.new(13,false)}
lines = readlines.map(&:chomp).map{|line| line.split}
lines
pattern = ["S", "H", "C", "D"]
lines.each do |line|
    ptn = line[0]
    rank = line[1].to_i
    cards[pattern.index(ptn)][rank-1] = true
end
cards.each_with_index do |card, i|
    card.each_with_index do |x, j|
        unless x then
            puts "#{pattern[i]} #{j+1}"
        end
    end
end
