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