cards, mark = {}, ["S", "H", "C", "D"]
mark.each{|m| cards[m] = (1..13).to_a}
cnt = gets.to_i
(1..cnt).each {|i| m, n = gets.split
  cards[m].delete(n.to_i)
}
mark.each{|m| cards[m].each{|n| puts"#{m} #{n}"}}
