card_with_mark = {}
mark = 'S'
4.times do |i|
    case i
    when 1
        mark = 'H'
    when 2
        mark = 'C'
    when 3
        mark = 'D'
    end
    13.times do |j|
        card_with_mark[[mark, j+1]] = true
    end
end
n = gets.chomp.to_i
n.times do
    mark, num = gets.split(" ")
    card_with_mark[[mark, num.to_i]] = false
end
card_with_mark.each do |key, value|
    if value == true
        print key[0], " ", key[1], "\n"
    end
end
