#include <bits/stdc++.h>
using namespace std;
bool qq(const pair<char, int> &a, const pair<char, int> &b) {
  return a.second < b.second;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, i;
  cin >> n >> m;
  int x = min(n, m);
  cout << x + 1 << endl;
  for (i = 0; i <= x; i++) {
    cout << i << " " << x - i << endl;
  }
}
