n = gets.chomp.to_i
s = (1..13).to_a
h = (1..13).to_a
c = (1..13).to_a
d = (1..13).to_a

while line = gets
  card = line.chomp.split(' ')
  if card[0] == 'S'
    s[card[1].to_i - 1] = 0
  elsif card[0] == 'H'
    h[card[1].to_i - 1] = 0
  elsif card[0] == 'C'
    c[card[1].to_i - 1] = 0
  elsif card[0] == 'D'
    d[card[1].to_i - 1] = 0
  end
end

s.each do |x|
  if x != 0
    print "S #{x}\n"
  end
end
h.each do |x|
  if x != 0
    print "H #{x}\n"
  end
end
c.each do |x|
  if x != 0
    print "C #{x}\n"
  end
end
d.each do |x|
  if x != 0
    print "D #{x}\n"
  end
end