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