Problem: Manao has invented a new mathematical term — a beautiful set of points. He calls a set of points on a plane beautiful if it meets the following conditions:

  1. The coordinates of each point in the set are integers. 
  2. For any two points from the set, the distance between them is a non-integer. 



Consider all points (x, y) which satisfy the inequations: 0 ≤ x ≤ n; 0 ≤ y ≤ m; x + y > 0. Choose their subset of maximum size such that it is also a beautiful set of points.

Input

The single line contains two space-separated integers n and m (1 ≤ n, m ≤ 100).

Output

In the first line print a single integer — the size k of the found beautiful set. In each of the next k lines print a pair of space-separated integers — the x- and y- coordinates, respectively, of a point from the set.

If there are several optimal solutions, you may print any of them.

Examples

Input

2 2


Output

3
0 1
1 2
2 0


Input

4 3


Output

4
0 3
2 1
3 0
4 2

Note

Consider the first sample. The distance between points (0, 1) and (1, 2) equals <image>, between (0, 1) and (2, 0) — <image>, between (1, 2) and (2, 0) — <image>. Thus, these points form a beautiful set. You cannot form a beautiful set with more than three points out of the given points. Note that this is not the only solution.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long modex(long long a, long long b, long long m) {
  if (b == 0) return 1;
  long long ans = a;
  long long save = 1;
  while (b != 1) {
    if (b % 2 == 1) {
      save *= ans;
      save %= m;
    }
    ans *= ans;
    ans %= m;
    b /= 2;
  }
  return (ans * save) % m;
}
long long mx, my;
void solve(long long a, long long b) {
  if (b == 0) {
    mx = 1;
    my = 0;
    return;
  }
  solve(b, a % b);
  long long x1 = mx;
  long long y1 = my;
  mx = y1;
  my = x1 - (a / b) * y1;
}
long long mi(long long x, long long m) {
  solve(x, m);
  return (mx + m) % m;
}
vector<long long> p;
vector<bool> prime;
void seive(int n) {
  prime.resize(n + 1);
  for (int i = 2; i < prime.size(); i++) prime[i] = 1;
  for (int i = 2; i * i <= n; i++) {
    if (!prime[i]) continue;
    int j = i + i;
    while (j <= n) {
      prime[j] = 0;
      j += i;
    }
  }
  for (int i = 2; i <= n; i++)
    if (prime[i]) p.push_back(i);
}
vector<long long> lpd;
void lpdgen(int n) {
  prime.resize(n + 1);
  lpd.resize(n + 1, 0);
  for (int i = 2; i <= n; i++) prime[i] = 1;
  for (int i = 2; i * i <= n; i++) {
    if (!prime[i]) continue;
    int j = i + i;
    while (j <= n) {
      prime[j] = 0;
      if (lpd[j] == 0) lpd[j] = i;
      j += i;
    }
  }
  for (int i = 2; i <= n; i++)
    if (prime[i]) lpd[i] = i;
}
template <typename T>
vector<T> compfactor(T x) {
  vector<T> ret;
  while (x != 1) {
    ret.push_back(lpd[x]);
    x /= lpd[x];
  }
  return ret;
}
template <typename T>
vector<T> pfactor(T x) {
  vector<T> ret;
  while (x != 1) {
    if (ret.size() == 0 || ret[ret.size() - 1] != lpd[x]) ret.push_back(lpd[x]);
    x /= lpd[x];
  }
  return ret;
}
vector<long long> fact;
void factgen(long long n, long long m) {
  fact.resize(n + 1);
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) {
    fact[i] = i * fact[i - 1];
    fact[i] %= m;
  }
}
template <typename T>
vector<T> factor(T x) {
  vector<T> ret;
  for (long long i = 1; i * i <= x; i++) {
    if (i * i == x) {
      ret.push_back(i);
      break;
    }
    if (x % i == 0) {
      ret.push_back(i);
      ret.push_back(x / i);
    }
  }
  return ret;
}
template <typename T>
void init(vector<T>& x, T n) {
  for (int i = 0; i < x.size(); i++) x[i] = n;
}
template <typename T>
void init2(vector<vector<T> >& x, T n) {
  for (int i = 0; i < x.size(); i++)
    for (int j = 0; j < x[i].size(); j++) x[i][j] = n;
}
template <typename T>
void init3(vector<vector<vector<T> > >& x, T n) {
  for (int i = 0; i < x.size(); i++)
    for (int j = 0; j < x[i].size(); j++)
      for (int k = 0; k < x[i][j].size(); k++) x[i][j][k] = n;
}
template <typename T>
void inits2(vector<vector<T> >& x, int a, int b) {
  x.resize(a);
  for (int i = 0; i < x.size(); i++) x[i].resize(b);
}
template <typename T>
void inits3(vector<vector<T> >& x, int a, int b, int c) {
  x.resize(a);
  for (int i = 0; i < x.size(); i++) {
    x[i].resize(b);
    for (int j = 0; j < x[i].size(); j++) x[i][j].resize(c);
  }
}
template <typename T>
T minarr(T* arr, int n) {
  T x = arr[0];
  for (int i = 0; i < n; i++) x = min(x, arr[i]);
  return x;
}
template <typename T>
T maxarr(T* arr, int n) {
  T x = arr[0];
  for (int i = 0; i < n; i++) x = max(x, arr[i]);
  return x;
}
template <typename T>
T minarr(vector<T>& arr) {
  T x = arr[0];
  for (int i = 0; i < arr.size(); i++) x = min(x, arr[i]);
  return x;
}
template <typename T>
T maxarr(vector<T>& arr) {
  T x = arr[0];
  for (int i = 0; i < arr.size(); i++) x = max(x, arr[i]);
  return x;
}
template <typename T>
void prt(vector<T>& x, int n) {
  for (int i = 0; i < n; i++) cout << x[i] << " ";
}
template <typename T>
void prt(T* x, int n) {
  for (int i = 0; i < n; i++) cout << x[i] << " ";
}
template <typename T>
void prtl(vector<T>& x, int n) {
  for (int i = 0; i < n; i++) cout << x[i] << endl;
}
template <typename T>
void prtl(T* x, int n) {
  for (int i = 0; i < n; i++) cout << x[i] << endl;
}
template <typename T>
void scan(T* arr, int n) {
  for (int i = 0; i < n; i++) cin >> arr[i];
}
template <typename T>
void scan(vector<T>& ret, int n) {
  for (int i = 0; i < n; i++) cin >> ret[i];
}
vector<int> failure(string& s) {
  vector<int> f(s.size(), 0);
  int ex = 0;
  for (int i = 1; i < s.size(); i++) {
    while (ex != 0 && s[ex] != s[i]) ex = f[ex - 1];
    if (ex == 0) {
      if (s[ex] != s[i]) {
        f[i] = 0;
        ex = 0;
        continue;
      }
    }
    f[i] = ex + 1;
    ex++;
  }
  return f;
}
int main() {
  int x, y;
  cin >> x >> y;
  int i = x;
  int j = 0;
  cout << min(x, y) + 1 << endl;
  while (1) {
    cout << i << " " << j << endl;
    i--;
    j++;
    if (i == -1 || j == y + 1) break;
  }
}