n = gets.to_i
data = {
    'S':[],
    'D':[],
    'C':[],
    'H':[],
}
num_set = [1,2,3,4,5,6,7,8,9,10,11,12,13]
n.times do |i|
    gara, num = gets.chomp.split
    data[gara.to_sym].push num.to_i
end
diff = num_set - data[:S]
diff.each{|d| puts "S #{d}"}
diff = num_set - data[:H]
diff.each{|d| puts "H #{d}"}
diff = num_set - data[:C]
diff.each{|d| puts "C #{d}"}
diff = num_set - data[:D]
diff.each{|d| puts "D #{d}"}
