s = Array.new(13, 0)
h = Array.new(13, 0)
c = Array.new(13, 0)
d = Array.new(13, 0)

gets.chomp.to_i.times do
  suit,num = gets.chomp.split
  num = num.to_i
  `print suit.downcase`[num-1] = 1 
end

s.each_with_index { |item, index| print "S #{index+1}\n" if item == 0 } 
h.each_with_index { |item, index| print "H #{index+1}\n" if item == 0 } 
c.each_with_index { |item, index| print "C #{index+1}\n" if item == 0 } 
d.each_with_index { |item, index| print "D #{index+1}\n" if item == 0 } 