s = Array.new( 13, false )
h = Array.new( 13, false )
c = Array.new( 13, false )
d = Array.new( 13, false )

n = gets.to_i
for i in ( 0 ... n )
	pattern, num = gets.split( " " )
	case pattern
		when "S"
			s[ num.to_i-1 ] = true
		when "H" 
			h[ num.to_i-1 ] = true
		when "C"
			c[ num.to_i-1 ] = true
		when "D"
			d[ num.to_i-1 ] = true
		else
	end
end

for i in ( 0 ... 13 )
	if !s[i]
		print( "S #{i+1}\n" )		
	end
end

for i in ( 0 ... 13 )
	if !h[i]
		print( "H #{i+1}\n" )	
	end
end

for i in ( 0 ... 13 )
	if !c[i]
		print( "C #{i+1}\n" )	
	end
end

for i in ( 0 ... 13 )
	if !d[i]
		print( "D #{i+1}\n" )	
	end
end