require "matrix"

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

def solve2step(x, y)
  b = Matrix[[K], [K], [x], [y]]
  [-1, 1].each{|i|
    [-1, 1].each{|j|
      [-1, 1].each{|k|
        [-1, 1].each{|l|
          a = Matrix[[i, j, 0, 0], [0, 0, k, l], [1, 0, 1, 0], [0, 1, 0, 1]]
          if a.determinant != 0 then
            ary = (a.inverse * b).column(0).to_a
            return ary.map(&:to_i) if ary.all?{|e| e.abs <= K && e.denominator == 1}
          end
        }
      }
    }
  }
  [0, 0, 0, 0]
end

ans = [[0, 0]]
if K.odd? || (X - Y).abs.even? then
  x1, y1 = [0, 0]
  signx = X.positive? ? 1 : -1
  K.step(X.abs - 1, K){|x| ans << [x * signx, 0]; x1 = x * signx}
  signy = Y.positive? ? 1 : -1
  K.step(Y.abs - 1, K){|y| ans << [x1, y * signy]; y1 = y * signy}
  if (X.abs + Y.abs) % K == 0 && (X - x1).abs + (Y - y1).abs == K then
    ans << [X, Y]
  else
    n = x1.abs / K + y1.abs / K
    if K.odd? && (X - Y + n).abs.odd? then
      if (X - x1).abs + (Y - y1).abs < K && ans.size > 1 then
        ans.pop
        x1, y1 = ans[-1]
      else
        y1 += (K * signy)
        ans << [x1, y1]
      end
    elsif (X - x1).abs + (Y - y1).abs < K && ans.size > 1 && K.even? then
      ans.pop
      x1, y1 = ans[-1]
    end
    x2, y2, x3, y3 = solve2step(X - x1, Y - y1)
    ans << [x1 + x2, y1 + y2]
    ans << [x1 + x2 + x3, y1 + y2 + y3]
  end
end

puts ans.size == 1 ? -1 : ans.size - 1
ans.each_with_index{|(x, y), i| printf("#{x} #{y}\n") if i > 0}
