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

  case suit
  when "S"
    s[num-1] = 1
  when "H"
    h[num-1] = 1
  when "C"
    c[num-1] = 1
  when "D"
    d[num-1] = 1
  end

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 }


                                                            