# frozen_string_literal: true

suit_map = { 'S' => 0, 'H' => 1, 'C' => 2, 'D' => 3 }
suits = %w[S H C D]
cards = Array.new(4).map { Array.new(13, false) }
n = gets.to_i
n.times do
  card = readline.split(' ')
  cards[suit_map[card[0]]][card[1].to_i - 1] = true
end
cards.each_with_index do |row, i|
  suit = suits[i]
  row.each_with_index do |b, j|
    puts "#{suit} #{j + 1}" unless b
  end
end

