numCards = gets.to_i;

aryCardField = Array.new(4).map{Array.new(13,false)};
 
for num in 0..numCards-1 do
 
	aryCardMarkNumber = gets.split(" ");
 
	cardMark = aryCardMarkNumber[0];
	cardNum = aryCardMarkNumber[1].to_i;
 
	case cardMark
	when "S" then
		aryCardField[0][cardNum-1] = true;
	when "H" then
		aryCardField[1][cardNum-1] = true;
	when "C" then
		aryCardField[2][cardNum-1] = true;
	when "D" then
		aryCardField[3][cardNum-1] = true;
	end
end

for countMark in 0..3 do
	for countNum in 0..12 do
		
		if aryCardField[countMark][countNum] == false then
			
			case countMark
			when 0 then
				puts "S " + (countNum+1).to_s;
			when 1 then
				puts "H " + (countNum+1).to_s;
			when 2 then
				puts "C " + (countNum+1).to_s;
			when 3 then
				puts "D " + (countNum+1).to_s;
			end
		end
		
	end
end