n=gets.to_i

n.times do
a,b=gets.split.map &:to_i
s=Array.new(b) if a.to_s=="S"
h=Array.new(b) if a.to_s=="H"
c=Array.new(b) if a.to_s=="C"
d=Array.new(b) if a.to_s=="D"
end

f=[1,2,3,4,5,6,7,8,9,10,11,12,13]

puts "S " + f.diff(s)*"¥n" if f.diff(s) != "nil"
puts "H " + f.diff(h)*"¥n" if f.diff(h) != "nil"
puts "C " + f.diff(c)*"¥n" if f.diff(c) != "nil"
puts "D " + f.diff(d)*"¥n" if f.diff(d) != "nil"
