n = gets.chomp.to_i

trump = {}
trump["S"] = [1,2,3,4,5,6,7,8,9,10,11,12,13]
trump["H"] = [1,2,3,4,5,6,7,8,9,10,11,12,13]
trump["C"] = [1,2,3,4,5,6,7,8,9,10,11,12,13]
trump["D"] = [1,2,3,4,5,6,7,8,9,10,11,12,13]

cards = {}
cards["S"] = []
cards["H"] = []
cards["C"] = []
cards["D"] = []
i = 0
while true do
   if i == n
      break
   end
   egara, temp_num = gets.split
   num = temp_num.to_i
   cards["#{egara}"] << num
   i += 1
end

empty_s = trump["S"] - cards["S"]
empty_s.each do |i|
   puts "S #{i}"
end

empty_h = trump["H"] - cards["H"]
empty_h.each do |i|
   puts "H #{i}"
end

empty_c = trump["C"] - cards["C"]
empty_c.each do |i|
   puts "C #{i}"
end

empty_d = trump["D"] - cards["D"]
empty_d.each do |i|
   puts "D #{i}"
end