n = gets.chomp.to_i

s = Array.new(13, 0)
h = Array.new(13, 0)
c = Array.new(13, 0)
d = Array.new(13, 0)

n.times do
  mark, rank = gets.chomp.split
  rank = rank.to_i

  case mark
  when 'S'
    s[rank - 1] = 1
  when 'H'
    h[rank - 1] = 1
  when 'C'
    c[rank - 1] = 1
  when 'D'
    d[rank - 1] = 1
  end
end

s.each_with_index do |s_i, i|
  puts "S #{i + 1}" if s_i == 0
end

h.each_with_index do |h_i, i|
  puts "H #{i + 1}" if h_i == 0
end

c.each_with_index do |c_i, i|
  puts "C #{i + 1}" if c_i == 0
end

d.each_with_index do |d_i, i|
  puts "D #{i + 1}" if d_i == 0
end

