#include <bits/stdc++.h>
using namespace std;
double dis(double x, double y, double a, double b) {
  double ans = ((x - a) * (x - a)) + ((y - b) * (y - b));
  return (sqrtl(ans));
}
int main() {
  int n, m;
  cin >> n >> m;
  int curx, cury;
  vector<pair<int, int> > ans;
  if (n == 0 && m == 0) {
    cout << 0;
    return 0;
  }
  for (int i = 0; i <= min(n, m); i++) {
    ans.push_back({i, min(n, m) - i});
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
