Problem: You are given a rectangular grid of lattice points from (0, 0) to (n, m) inclusive. You have to choose exactly 4 different points to build a polyline possibly with self-intersections and self-touching. This polyline should be as long as possible.

A polyline defined by points p1, p2, p3, p4 consists of the line segments p1 p2, p2 p3, p3 p4, and its length is the sum of the lengths of the individual line segments.

Input

The only line of the input contains two integers n and m (0 ≤ n, m ≤ 1000). It is guaranteed that grid contains at least 4 different points.

Output

Print 4 lines with two integers per line separated by space — coordinates of points p1, p2, p3, p4 in order which represent the longest possible polyline.

Judge program compares your answer and jury's answer with 10 - 6 precision.

Examples

Input

1 1


Output

1 1
0 0
1 0
0 1


Input

0 10


Output

0 1
0 10
0 0
0 9

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T _sq(T a) {
  return a * a;
}
template <class T>
inline T _sqrt(T a) {
  return (T)sqrt((double)a);
}
template <class T, class X>
inline T _pow(T a, X y) {
  T z = 1;
  for (int i = 1; i <= y; i++) {
    z *= a;
  }
  return z;
}
template <class T>
inline T _gcd(T a, T b) {
  a = abs(a);
  b = abs(b);
  if (!b) return a;
  return _gcd(b, a % b);
}
template <class T>
inline T _lcm(T a, T b) {
  a = abs(a);
  b = abs(b);
  return (a / _gcd(a, b)) * b;
}
template <class T>
inline T _extended(T a, T b, T &x, T &y) {
  a = abs(a);
  b = abs(b);
  T g, x1, y1;
  if (!b) {
    x = 1;
    y = 0;
    g = a;
    return g;
  }
  g = _extended(b, a % b, x1, y1);
  x = y1;
  y = x1 - (a / b) * y1;
  return g;
}
template <class T, class X>
inline bool getbit(T a, X i) {
  T t = 1;
  return ((a & (t << i)) > 0);
}
template <class T, class X>
inline T setbit(T a, X i) {
  T t = 1;
  return (a | (t << i));
}
template <class T, class X>
inline T resetbit(T a, X i) {
  T t = 1;
  return (a & (~(t << i)));
}
template <class T, class X>
inline T togglebit(T a, X i) {
  T t = 1;
  return (a ^ (t << i));
}
template <class T>
void pv(T v) {
  for (int i = 0; i < ((int)v.size()); i++) cout << v[i] << " ";
  cout << endl;
}
template <class T>
inline void unify(vector<T> &a) {
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
}
template <class T, class X>
inline T _bigmod(T n, X m) {
  unsigned long long ret = 1, a = n % 1000000007;
  while (m) {
    if (m & 1) ret = (ret * a) % 1000000007;
    m >>= 1;
    a = (a * a) % 1000000007;
  }
  ret %= 1000000007;
  return (T)ret;
}
template <class T>
inline T _modinv(T n) {
  return _bigmod(n, 1000000007 - 2);
}
long long n, m;
vector<pair<int, int> > d, vv;
long long dp[20][(1 << 16) + 2];
void gen() {
  d.push_back(make_pair(0, 0));
  d.push_back(make_pair(0, 1));
  d.push_back(make_pair(1, 0));
  d.push_back(make_pair(1, 1));
  d.push_back(make_pair(0, m));
  d.push_back(make_pair(0, m - 1));
  d.push_back(make_pair(1, m));
  d.push_back(make_pair(1, m - 1));
  d.push_back(make_pair(n, 0));
  d.push_back(make_pair(n, 1));
  d.push_back(make_pair(n - 1, 0));
  d.push_back(make_pair(n - 1, 1));
  d.push_back(make_pair(n, m));
  d.push_back(make_pair(n, m - 1));
  d.push_back(make_pair(n - 1, m));
  d.push_back(make_pair(n - 1, m - 1));
  for (int i = 0; i < ((int)d.size()); i++) {
    if ((d[i].first >= 0 && d[i].first <= n) &&
        (d[i].second >= 0 && d[i].second <= m)) {
      vv.push_back(d[i]);
    }
  }
  unify(vv);
  return;
}
long long dist(int i, int j) {
  return (vv[i].first - vv[j].first) * (vv[i].first - vv[j].first) +
         (vv[i].second - vv[j].second) * (vv[i].second - vv[j].second);
}
long long go(int p, int b, int n) {
  if (n == 4) {
    return 0;
  }
  long long &ret = dp[p][b];
  if (ret != -1) return ret;
  ret = 0;
  for (int i = 0; i < ((int)vv.size()); i++) {
    if (!getbit(b, i)) {
      ret = max(ret, (n != 0 ? dist(p, i) : 0) + go(i, setbit(b, i), n + 1));
    }
  }
  return ret;
}
void print(int p, int b, int n) {
  if (n == 4) {
    return;
  }
  for (int i = 0; i < ((int)vv.size()); i++) {
    if (!getbit(b, i)) {
      if (go(p, b, n) ==
          (n != 0 ? dist(p, i) : 0) + go(i, setbit(b, i), n + 1)) {
        cout << vv[i].first << " " << vv[i].second << endl;
        print(i, setbit(b, i), n + 1);
        return;
      }
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  gen();
  memset(dp, -1, sizeof dp);
  go(0, 0, 0);
  print(0, 0, 0);
  return 0;
}