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