marks = ["S","H","C","D"]
all_card = []

marks.each do |mark|
	for i in 1..13
		all_card << mark + " " + i.to_s 
	end
end

puts all_card

N = gets.to_i
N.times do
	card = gets.chomp
	all_card.delete(card)
end
puts all_card.join("\n")