# ???????????????'S'???????????????'H'???????????????'C'???????????????'D'
cards = { 
  "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.chomp.to_i
n.times do
  mark, num = gets.chomp.split(" ")
  num = num.to_i
  cards[mark][num-1] = false
end

["S", "H", "C", "D"].each {|mark| cards[ mark ].each {|num| puts "#{ mark } #{ num }" if num } }