a = Array.new(4){ Array.new(13, false) }
n = gets.to_i
table1 = {"S" => 0, "H" => 1, "C" => 2, "D" =>3}
table2 = ["S", "H", "C", "D"]
while line = gets do
  m, r = line.split
  a[table1[m]][r.to_i - 1] = true
end

0.upto(3) do |i|
  0.upto(12) do |j|
    if a[i][j] == false then puts "#{table2[i]} #{j + 1}"
  end
end