#include <bits/stdc++.h>
using namespace std;
void printv(vector<int> vector1) {
  for (long long i = 0; i < vector1.size(); i++) cout << vector1[i] << " ";
  cout << endl;
}
int main() {
  int n, m;
  cin >> n >> m;
  int minn = min(n, m);
  cout << minn + 1 << endl;
  for (int i = 0; i <= minn; i++) cout << minn - i << " " << i << endl;
}
