#include <bits/stdc++.h>
using namespace std;
int a[101];
int b[101];
int main() {
  int n, m;
  int N;
  cin >> n >> m;
  N = min(n, m);
  cout << N + 1 << endl;
  for (int i = 0; i <= N; i++) cout << i << " " << N - i << endl;
  return 0;
}
