#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-8;
template <class T>
inline void read(T &i) {
  bool minus = false;
  char c;
  for (c = getchar(); (c < '0' || c > '9') && (c != '-'); c = getchar())
    ;
  if (c == '-') {
    minus = true;
    c = '0';
  }
  for (i = 0; c >= '0' && c <= '9'; c = getchar())
    i = (i << 3) + (i << 1) + (c - 48);
  if (minus) i = (~i) + 1;
}
int gcd(int a, int b) {
  if (a == b) return b;
  if (b < a) return gcd(a % b, b);
  return gcd(a, b % a);
}
vector<string> parse(string s, string c) {
  int len = c.length(), p = -len, np;
  vector<string> ans;
  do {
    np = s.find(c, p + len);
    ans.push_back(s.substr(p + len, np - p - len));
    p = np;
  } while (p != string::npos);
  return ans;
}
int main() {
  int m, n, k;
  cin >> n >> m;
  cout << min(m, n) + 1 << endl;
  for (int k = 0; k <= min(m, n); k++) cout << n - k << "  " << k << endl;
  return 0;
}
