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