#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  {
    int i, x, y, a, b;
    cin >> x >> y;
    cout << min(x, y) + 1 << "\n";
    a = min(x, y);
    if (x == 0 || y == 0) {
      cout << x << " " << y << "\n";
    } else {
      for (i = 0; i <= a; i++) {
        cout << i << " " << a - i << "\n";
      }
    }
  }
  return 0;
}
