#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 123;
const int mod = 1e9 + 7;
const int INF = 1e9 + 1;
const long long INFL = 3e18 + 1;
const double pi = acos(-1.0);
int n, m;
vector<pair<int, int> > ans;
vector<pair<int, int> > v;
long double dist(int x1, int y1, int x2, int y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  int x = 0, y = m;
  while (x <= n && y >= 0) {
    ans.push_back(make_pair(x, y));
    x++;
    y--;
  }
  cout << ans.size() << '\n';
  for (auto i : ans) cout << i.first << ' ' << i.second << endl;
  return 0;
}
