cards ={S:(1..13).to_a, H:(1..13).to_a, C:(1..13).to_a,D:(1..13).to_a}

n = gets.to_i
n.times{
   rank,label = gets.split(" ")
    case rank
   when "S"
     cards[:S] -= [label.to_i]
   when "H"
     cards[:H] -= [label.to_i]
   when "C"
     cards[:C] -= [label.to_i]
   when "D"
     cards[:D] -= [label.to_i]
     end
}
cards[:S].each do |i|
    puts "S #{i}"
end
cards[:H].each do |i|
    puts "H #{i}"
end
cards[:C].each do |i|
    puts "C #{i}"
end
cards[:D].each do |i|
    puts "D #{i}"
end