arr = Array.new(4){ Array.new(13, 0) }
mark = ["S","C","H","D"]
(gets.to_i).times do
check = gets.split
arr[mark.index(check[0])][(check[1].to_i)-1] = 1
end

4.times do |i|
  13.times do |j|
    if arr[i][j] == 0 then
      puts "#{mark[i]} #{j+1}"
    end
  end
end