mark = []
number = []
spade = []
heart = []
club = []
diamond = []
n = 0

count = gets.to_i

for i in 0..count-1 do

	mar , num = gets.split(" ") 
	mark << mar
	number << num.to_i

end

mark.each do |str|

	case str
	
	when "S" then
		spade[number[n]] = 1 
	when "H" then
		heart[number[n]] = 1 
	when "C" then
		club[number[n]] = 1 
	when "D" then
		diamond[number[n]] = 1 
	end

	n += 1

end

for i in 1..13 do
	if spade[i] != 1 then
		puts "S #{i}"
	end
end

for i in 1..13 do
	if heart[i] != 1 then
		puts "H #{i}"
	end
end

for i in 1..13 do
	if club[i] != 1 then
		puts "C #{i}"
	end
end

for i in 1..13 do
	if diamond[i] != 1 then
		puts "D #{i}"
	end
end








 