cards = []
["S", "H", "C", "D"].each do |i|
  ("1".."13").each do |j|
    cards.push [i, j]
  end
end

n = gets.to_i
taro_cards = []
n.times do
  taro_cards.push gets.chomp.split(" ")
end

difference = cards - taro_cards
difference.each do |i|
  puts i.join(" ")
end