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
for i in 1..n
  mark, num = gets.split
  num = num.to_i
    if mark == S
      s.delete(num)
    elsif mark == H
      h.delete(num)
    elsif mark == C
      c.delete(num)
    else
      d.delete(num)
    end
end

s.each { |x|
    puts "S #{x}"
}
h.each { |x|
    puts "H #{x}"
}
c.each { |x|
    puts "C #{x}"
}
s.each { |x|
    puts "D #{x}"
}