#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> out;
  int i = n, j = 0;
  while (i >= 0 && j <= m) {
    out.push_back({i, j});
    i--;
    j++;
  }
  cout << out.size() << "\n";
  for (int i = 0; i < out.size(); i++) {
    cout << out[i].first << " " << out[i].second << "\n";
  }
}
