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