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 <typename T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (T x : p) os << x << " ";
  os << "]" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const multiset<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const map<Tk, Tv>& p) {
  os << "{ ";
  for (pair<Tk, Tv> x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {
  os << "{" << p.first << ',' << p.second << "}";
  return os;
}
long long gcd(long long a, long long b) { return (a ? gcd(b % a, a) : b); }
long long power(long long a, long long n) {
  long long p = 1;
  while (n > 0) {
    if (n & 1) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
long long power(long long a, long long n, long long mod) {
  long long p = 1;
  while (n > 0) {
    if (n & 1) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
double dist(double x1, double y1, double x2, double y2) {
  double dx = (x1 - x2), dy = (y1 - y2);
  return sqrt(dx * dx + dy * dy);
}
double p[3], z[3];
int ans[4][2];
vector<int> v;
vector<pair<int, int> > a;
int main() {
  int i, j;
  int n, m;
  scanf("%d", &n), scanf("%d", &m);
  for (i = 0; i < n + 1; i++)
    for (j = 0; j < m + 1; j++) {
      if (!(i == 0 && j == 0) && !(i == n && j == m)) {
        if (dist(n, m, i, j) > p[0]) {
          p[0] = dist(n, m, i, j);
          p[1] = i;
          p[2] = j;
        }
      }
      if (!(i == n && j == m) && !(i == 0 && j == 0)) {
        if (dist(0, 0, i, j) >= z[0]) {
          z[0] = dist(0, 0, i, j);
          z[1] = i;
          z[2] = j;
        }
      }
    }
  for (i = 0; i < 4; i++) v.push_back(i);
  a.push_back({0, 0});
  a.push_back({n, m});
  a.push_back({p[1], p[2]});
  a.push_back({z[1], z[2]});
  double di = 0;
  while (next_permutation(v.begin(), v.end())) {
    double x = 0;
    for (i = 1; i < 4; i++)
      x += dist(a[v[i - 1]].first, a[v[i - 1]].second, a[v[i]].first,
                a[v[i]].second);
    if (di < x) {
      di = x;
      for (i = 0; i < 4; i++)
        ans[i][0] = a[v[i]].first, ans[i][1] = a[v[i]].second;
    }
  }
  double d2 = 2 * dist(0, 0, n, m) + max(n, m);
  if (d2 > di && n > 0 && m > 0) {
    di = d2;
    ans[0][0] = 0, ans[0][1] = 0;
    ans[1][0] = n, ans[1][1] = m;
    if (n < m) {
      ans[2][0] = n, ans[2][1] = 0;
      ans[3][0] = 0, ans[3][1] = m;
    } else {
      ans[2][0] = 0, ans[2][1] = m;
      ans[3][0] = n, ans[3][1] = 0;
    }
  }
  for (i = 0; i < 4; i++) printf("%d ", ans[i][0]), printf("%d\n", ans[i][1]);
  return 0;
}