S=[nil]*13
H=[nil]*13
C=[nil]*13
D=[nil]*13

gets.to_i.times do
   c,n = gets.split
    n=n.to_i
     eval("%s[%d]=true"%[c,n-1])
end

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