#include <bits/stdc++.h>
using namespace std;
int main() {
  int 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 << endl;
}
