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

gets # ignore
while line = gets
  pattern, n = line.chomp.split
  i = n.to_i - 1
  case pattern
  when "S" then s[i] = true
  when "H" then h[i] = true
  when "C" then c[i] = true
  when "D" then d[i] = true
  end
end

s.each_with_index { |_, i| puts "S #{i+1}" unless s[i]}
h.each.with_index { |_, i| puts "H #{i+1}" unless h[i]}
c.each.with_index { |_, i| puts "C #{i+1}" unless c[i]}
d.each.with_index { |_, i| puts "D #{i+1}" unless d[i]}

