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