s = {}
h = {}
c = {}
d = {}

suit = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"]

n = gets.chomp.to_i
n.times do
  mark, card = gets.chomp.split
  case mark
  when 'S' then s[card] = 1
  when 'H' then h[card] = 1
  when 'C' then c[card] = 1
  when 'D' then d[card] = 1
  end
end

(suit - s.keys).each do |card|
  puts "S #{card}"
end

(suit - h.keys).each do |card|
  puts "H #{card}"
end

(suit - c.keys).each do |card|
  puts "C #{card}"
end

(suit - d.keys).each do |card|
  puts "D #{card}"
end