K = gets.chomp.to_i
X, Y = gets.chomp.split(" ").map(&:to_i)

def dist_goal(x, y)
  (X - x).abs + (Y - y).abs
end

def scan_next(x, y)
  n = (-K+1..K-1).map do |i|
    ys = K - i.abs
    [x + i, y + ys]
  end
  n + n.map{|i,j| [i, y-(j-y)]} + [[x-K, y], [x+K, y]]
end

def found(i, routes, xy)
  puts i
  r = routes[xy]
  (i-1).times do |j|
    puts r.join(" ")
    r = routes[r]
  end
  exit
end

xs = ys = 0
d = dist_goal(xs, ys)
if K % 2 == 0 && d % 2 == 1
  puts "-1"
  exit
end
dp = { 0 => {} }
dp[0][d % K] = [0, 0]
i = 1
routes = {}
loop do
  dp[i] = {}
  dp[i - 1].each do |sc, xy|
    xs, ys = xy
    scan_next(xs, ys).each do |x, y|
      d = dist_goal(x, y)
      score = d % K
      if d.zero?
        routes[[x, y]] = [xs, ys]
        found(i, routes, [x, y])
      end
      if !dp[i][score] || d < dist_goal(*dp[i][score])
        dp[i][score] = [x, y]
        routes[[x, y]] = [xs, ys]
      end
    end
  end
  i += 1
end
