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;
#pragma comment(linker, "/STACK:64000000")
const int maxn = 18;
const int maxm = 110;
const int maxmask = (1 << maxn) - 1;
const int infi = 1e9 + 7;
const long long infl = 1e18;
const double eps = 1e-6;
const int mod = 1e9 + 7;
vector<pair<int, int> > ar;
pair<int, int> ans[4];
int sqr(int a) { return a * a; }
double dist(pair<int, int> a, pair<int, int> b) {
  return sqrt((double)sqr(a.first - b.first) + sqr(a.second - b.second));
}
vector<pair<int, int> > arz, arx;
int main() {
  int n, m;
  cin >> n >> m;
  arz.push_back(make_pair(0, 0)), arz.push_back(make_pair(0, 1)),
      arz.push_back(make_pair(1, 0)), arz.push_back(make_pair(1, 1));
  arz.push_back(make_pair(n, m)), arz.push_back(make_pair(n - 1, m)),
      arz.push_back(make_pair(n, m - 1)),
      arz.push_back(make_pair(n - 1, m - 1));
  arz.push_back(make_pair(0, m)), arz.push_back(make_pair(1, m)),
      arz.push_back(make_pair(0, m - 1)), arz.push_back(make_pair(1, m - 1));
  arz.push_back(make_pair(n, 0)), arz.push_back(make_pair(n, 1)),
      arz.push_back(make_pair(n - 1, 0)), arz.push_back(make_pair(n - 1, 1));
  sort(arz.begin(), arz.end());
  for (int i = 0; i < arz.size() - 1; ++i) {
    if (arz[i] != arz[i + 1] && arz[i].first >= 0 && arz[i].first <= n &&
        arz[i].second >= 0 && arz[i].second <= m) {
      arx.push_back(arz[i]);
    }
  }
  int i = arz.size() - 1;
  if (arz[i].first >= 0 && arz[i].first <= n && arz[i].second >= 0 &&
      arz[i].second <= m) {
    arx.push_back(arz[i]);
  }
  double res = 0;
  int k = arx.size();
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < k; ++j) {
      if (i == j) {
        continue;
      }
      double a = dist(arx[i], arx[j]);
      int z, x;
      z = x = -1;
      for (int q = 0; q < arx.size(); ++q) {
        if (arx[q] == arx[i] || arx[q] == arx[j]) {
          continue;
        }
        if (z == -1 || dist(arx[z], arx[i]) < dist(arx[q], arx[i])) {
          z = q;
        }
      }
      for (int q = 0; q < arx.size(); ++q) {
        if (arx[q] == arx[i] || arx[q] == arx[j]) {
          continue;
        }
        if (x == -1 || dist(arx[x], arx[j]) < dist(arx[q], arx[j])) {
          x = q;
        }
      }
      if (x == z) {
        z = -1;
        for (int q = 0; q < arx.size(); ++q) {
          if (arx[q] == arx[i] || arx[q] == arx[j]) {
            continue;
          }
          if (q != x &&
              (z == -1 || dist(arx[z], arx[i]) < dist(arx[q], arx[i]))) {
            z = q;
          }
        }
        double b = dist(arx[z], arx[i]) + dist(arx[x], arx[j]);
        int s = z;
        z = x;
        x = -1;
        for (int q = 0; q < arx.size(); ++q) {
          if (arx[q] == arx[i] || arx[q] == arx[j]) {
            continue;
          }
          if (q != z &&
              (x == -1 || dist(arx[x], arx[j]) < dist(arx[q], arx[j]))) {
            x = q;
          }
        }
        double c = dist(arx[z], arx[i]) + dist(arx[x], arx[j]);
        int d = x;
        x = z;
        if (c > b) {
          x = d;
        } else {
          z = s;
        }
      }
      a += dist(arx[z], arx[i]) + dist(arx[x], arx[j]);
      if (a > res) {
        res = a;
        ans[0] = arx[z], ans[1] = arx[i], ans[2] = arx[j], ans[3] = arx[x];
      }
    }
  }
  for (int i = 0; i < 4; ++i) {
    cout << ans[i].first << ' ' << ans[i].second << endl;
  }
  return 0;
}