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;
template <typename T>
T prod(const T &a, const T &b, const T &mod) {
  return ((a % mod) * (b % mod)) % mod;
}
template <typename T>
T pow_(const T &a, const T &b) {
  if (!b) return 1;
  T p = pow_(a, b / 2);
  p *= p;
  return (b % 2) ? (p * a) : p;
}
template <typename T>
T modpow(const T &a, const T &b, const T &mod) {
  if (!b) return 1;
  T p = modpow(a, b / 2);
  p = prod(p, p);
  return (b % 2) ? (prod(p, a)) : p;
}
template <typename T>
T max(const T &a, const T &b, const T &c) {
  return max(a, max(b, c));
}
template <typename T>
T min(const T &a, const T &b, const T &c) {
  return min(a, min(b, c));
}
template <typename T>
void dbg(const vector<T> &a, int l, int r) {
  for (long long int i = l; i <= r; i++) cout << a[i] << " ";
  cout << endl;
}
template <typename T>
void dbg(const vector<T> &a) {
  for (long long int i = 0; i <= a.size() - 1; i++) cout << a[i] << " ";
  cout << endl;
}
void main_() {
  long long int n, m;
  cin >> n >> m;
  cout << min(n, m) + 1 << endl;
  n = min(n, m);
  vector<pair<long long int, long long int> > ans;
  for (long long int i = 0; i <= n; i++) ans.push_back(make_pair(i, n - i));
  for (long long int i = 0; i <= ans.size() - 1; i++) {
    for (long long int j = 0; j <= ans.size() - 1; j++)
      if (i == j)
        continue;
      else {
        long long int dis = (abs(ans[i].first - ans[j].first) *
                             abs(ans[i].first - ans[j].first)) +
                            (abs(ans[i].second - ans[j].second) *
                             abs(ans[i].second - ans[j].second));
        long long int root = sqrt(dis);
        if ((root * root) == dis) {
          cout << root << " " << dis << endl;
          cout << ans[i].first << " " << ans[i].second << endl;
          cout << ans[j].first << " " << ans[j].second << endl;
          cout << "-1\n";
          return;
        }
      }
  }
  for (long long int i = 0; i <= n; i++) cout << i << " " << n - i << endl;
}
int main() {
  { main_(); }
  return 0;
}