heart = []
club = []
diamond = []

n.times do
	suit, rank = gets.split
	
	case suit
	when 'S'
		spade << rank.to_i
	when 'H'
		heart << rank.to_i
	when 'C'
		club << rank.to_i
	when 'D'
		diamond << rank.to_i
	end
end

1.upto(13) do |r|
	puts "S #{r}" unless spade.include?(r)
	puts "H #{r}" unless heart.include?(r)
	puts "C #{r}" unless club.include?(r)
	puts "D #{r}" unless diamond.include?(r)
end