num=gets.to_i
i=1
cards = Hash.new{|h,k| h[k] = [] }
while i <= num
symbol, numeric = gets.chomp.split
cards[symbol] << numeric.to_i
i += 1
end

shortage = Hash.new{|h,k| h[k] = [] }
cards["S"].sort!
cards["H"].sort!
cards["C"].sort!
cards["D"].sort!

(1..13).times do |i|
  if cards["S"][i] == ""
    shortage["S"] << i
  end    
end
(1..13).times do |i|
  if cards["H"][i] == ""
    shortage["H"] << i
  end    
end
(1..13).times do |i|
  if cards["C"][i] == ""
    shortage["C"] << i
  end    
end
(1..13).times do |i|
  if cards["D"][i] == ""
    shortage["D"] << i
  end    
end

puts shortage