#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  n = min(n, m);
  cout << n + 1 << "\n";
  for (int i = 0; i <= n; i++) cout << i << " " << n - i << "\n";
  return 0;
}
