count = gets.to_i

arr = []

count.times { arr << gets.split(" ") }

arr.sort!

arr_c = []; arr_d = []; arr_h = []; arr_s = []

arr.each do |val|
  case val[0]
  when "C"
    arr_c << val[1].to_i
  when "D"
    arr_d << val[1].to_i
  when "H"
    arr_h << val[1].to_i
  else
    arr_s << val[1].to_i
  end
end

arr_c.sort!; arr_d.sort!; arr_h.sort!; arr_s.sort!
ans_c = []; ans_d = []; ans_h = []; ans_s = [];

ans_s << ((1..13).to_a - arr_s).map{ |val| "S" + " " + val.to_s }
ans_h << ((1..13).to_a - arr_h).map{ |val| "H" + " " + val.to_s }
ans_c << ((1..13).to_a - arr_c).map{ |val| "C" + " " + val.to_s }
ans_d << ((1..13).to_a - arr_d).map{ |val| "D" + " " + val.to_s }

puts ans_s
puts ans_h
puts ans_c
puts ans_d