n = gets.chomp.to_i

heart = []
spade = []
club = []
dia = []
for i in 1..13
  heart.push(i)
  spade.push(i)
  club.push(i)
  dia.push(i)
end

n.times do
  design, rank = gets.chomp.split
  rank = rank.to_i
  case design
  when "S"
    spade.delete(rank)
  when "H"
    heart.delete(rank)
  when "C"
    club.delete(rank)
  when "D"
    dia.delete(rank)
  end
end


spade.size.times do |i|
  puts "S #{spade[i]}"
end
heart.size.times do |i|
  puts "H #{heart[i]}"
end
club.size.times do |i|
  puts "C #{club[i]}"
end
dia.size.times do |i|
  puts "D #{dia[i]}"
end