n = gets.to_i

hash = {}

(1..n).each do
  m, i = gets.split
  hash[m + i] = 1
end

%w[S H C D].each do |m|
  (1..13).each do |i|
    is_absent = !hash.key?(m + i.to_s)
    puts "#{m} #{i}" if is_absent
  end
end

