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