#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long dis(long long x, long long y, long long xx, long long yy) {
  return (x - xx) * (x - xx) + (y - yy) * (y - yy);
}
int main() {
  int n, m;
  cin >> n >> m;
  cout << min(n, m) + 1 << endl;
  for (int i = 0; i <= min(n, m); i++) {
    cout << min(n, m) - i << " " << i << "\n";
  }
}
