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