#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, mn;
  scanf("%d %d", &n, &m);
  mn = min(n, m);
  printf("%d\n", mn + 1);
  for (int i = 0; i <= mn; i++) {
    printf("%d %d\n", mn - i, i);
  }
  return 0;
}
