data = {}
while true
  mark, rank = gets.chomp.split(/\s/) rescue break
  data[mark] ||= []
  data[mark][rank.to_i] = 1
end

%w(S H C D).each do |m|
  (1..13).each do |r|
    puts "#{m} #{r}" unless data[m][r]
  end
end