s =[1,2,3,4,5,6,7,8,9,10,11,12,13]
h =[1,2,3,4,5,6,7,8,9,10,11,12,13]
c =[1,2,3,4,5,6,7,8,9,10,11,12,13]
d =[1,2,3,4,5,6,7,8,9,10,11,12,13]

n = gets.to_i
n.times{
  x,y = gets.split.map(&:to_s)
  y = y.to_i
  case
  when x == "S"
    s.delete(y)
  when x == "H"
    h.delete(y)
  when x == "C"
    c.delete(y)
  when x == "D"
    d.delete(y)
  else
    puts "nothing"
  end
}

s.each do |elem|
  print "S ", elem,"\n"
end
h.each do |elem|
  print "H ", elem,"\n"
end
c.each do |elem|
  print "C ", elem,"\n"
end
d.each do |elem|
  print "D ", elem,"\n"
end

