#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m, n, g, s, i;
  cin >> n >> m;
  g = ((m > n) ? m : n);
  s = ((m < n) ? m : n);
  cout << s + 1 << endl;
  if (m > n)
    for (i = 0; i <= n; i++) cout << n - i << " " << i << endl;
  else
    for (i = 0; i <= m; i++) cout << m - i << " " << i << endl;
  return 0;
}
