#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265358979323846;
void rw() {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, p = 0;
  cin >> n >> m;
  vector<pair<long long, long long> > t;
  while (n >= 0 && p <= m) {
    t.push_back({n, p});
    n--, p++;
  }
  cout << t.size() << "\n";
  for (auto i : t) cout << i.first << " " << i.second << "\n";
  return 0;
}
