n = gets.to_i
cards = Array.new(n)
all_cards = Array.new(4).map{Array.new(13)}
4.times do |i|
	for j in 1..13 do
		if i == 0
			all_cards[i][j - 1] = ["S",j]
		elsif i == 1
			all_cards[i][j - 1] = ["H",j]
		elsif i == 2
			all_cards[i][j - 1] = ["C",j]
		else
			all_cards[i][j - 1] = ["D",j]
		end
	end
end
n.times do |i|
	cards[i] = gets
	cards[i] = cards[i].split(" ")
	cards[i][1] = cards[i][1].to_i
end
4.times do |i|
	n.times do |j|
		all_cards[i].delete(cards[j])
	end
end
4.times do |i|
	13.times do |j|
		if all_cards[i][j] != nil
			puts all_cards[i][j].join(" ")
		end
	end
end