n = gets.to_i
lacks = []
%w(S H C D).each do |suite|
    (1..13).each do |num|
        lacks << [suite,num]
    end
end

n.times do
    suite,num = gets.split(' ')
    lacks.delete([suite,num.to_i])
end

lacks.each do |ary|
    puts ary.join(' ')
end
 
