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