mark = ["S", "H", "C", "D"]
card = Array.new
hand = Array.new
i = 0
j = 1
k = 0
4.times do
    13.times do
        card[k] = [mark[i], "#{j}"]
        k += 1
        j += 1
    end
    j = 1
    i += 1
end

i = 0
n = gets.to_i
n.times do
    hand[i] = gets.split
    i += 1
end

i = 0
hand.each{|var|
52.times do
    if !(var == card[i]) then
        puts card[i].join(" ") if card[i] != nil
    end
    i += 1
end
}