#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<pair<int, int> > v;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i <= min(n, m); i++) v.push_back(make_pair(i, min(n, m) - i));
  printf("%d\n", v.size());
  for (int i = 0; i < v.size(); i++) printf("%d %d\n", v[i].first, v[i].second);
  return 0;
}
