num = gets.to_i
s = []
h = []
c = []
d = []

def look_for_lost(kind, a)
  a = a.sort
  for i in 1..13 do
    flag = false
    a.each do |x|
      if x == i then flag = true end
    end
    if flag == false then puts "#{kind} #{i}" end
  end
end

for i in 1..num do
  card = gets.chomp
  case card.split(" ")[0]
  when "S" then
    s << card.split(" ")[1].to_i
  when "H" then
    h << card.split(" ")[1].to_i
  when "C" then
    c << card.split(" ")[1].to_i
  when "D" then
    d << card.split(" ")[1].to_i
  end
end

look_for_lost("S", s)
look_for_lost("H", h)
look_for_lost("C", c)
look_for_lost("D", d)