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