#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y;
  cin >> x >> y;
  int count = min(x, y);
  if (count == 0) {
    cout << 0 << endl;
    return 0;
  }
  cout << count + 1 << endl;
  for (int i = 0; i <= count; i++) {
    cout << i << " " << count - i << endl;
  }
  return 0;
}
