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