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