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