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