#include <bits/stdc++.h>
int main() {
  int n, m;
  std::cin >> n >> m;
  if (n == 0) {
    std::cout << 1 << std::endl;
    std::cout << 0 << 1 << std::endl;
  } else if (m == 0) {
    std::cout << 1 << std::endl;
    std::cout << 1 << ' ' << 0 << std::endl;
  } else {
    int result = std::min(n, m);
    ++result;
    std::cout << result << std::endl;
    int curr_x = 0, curr_y = m;
    for (int i = 0; i < result; ++i) {
      std::cout << curr_x << ' ' << curr_y << std::endl;
      ++curr_x;
      --curr_y;
    }
  }
  return 0;
}
