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