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