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