S,H,C,D=[[nil]*13]*4
gets.to_i.times do
 c,n = gets.split
 eval("%s[%d]=true"%[c,n-1])
end

S.each_with_index{|x,i| puts "S " + (i+1).to_s }
H.each_with_index{|x,i| puts "H " + (i+1).to_s }
C.each_with_index{|x,i| puts "C " + (i+1).to_s }
D.each_with_index{|x,i| puts "D " + (i+1).to_s }