a = Array.new(4) { |i| Array.new(13) { |j| false } }
c = [ "S", "H", "C", "D" ]
n = gets.to_i
n.times do
  s, i = gets.split
  case s
  when "S"
    a[0][i.to_i-1] = true
  when "H"
    a[1][i.to_i-1] = true
  when "C"
    a[2][i.to_i-1] = true
  else
    a[3][i.to_i-1] = true
  end
end 

4.times do |i|
  13.times do |j|
    puts "#{c[i]} #{j+1}" unless a[i][j]
  end
end