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;
const int N = 1e6 + 10;
int n, m;
long long dist(int x, int y, int xx, int yy) {
  return ((x - xx) * 1ll * (x - xx) + (y - yy) * 1ll * (y - yy));
}
bool ok(int x, int y) { return (x >= 0 && x <= n && y >= 0 && y <= m); }
int main() {
  scanf("%d %d", &n, &m);
  vector<pair<int, int>> v;
  for (int i = 0; i < 12; ++i) {
    if (ok(i, 0)) v.push_back({i, 0});
    if (ok(0, i)) v.push_back({0, i});
  }
  for (int i = 0; i < 12; ++i) {
    if (ok(n - i, 0)) v.push_back({n - i, 0});
    if (ok(n, i)) v.push_back({n, i});
  }
  for (int i = 0; i < 12; ++i) {
    if (ok(0, m - i)) v.push_back({0, m - i});
    if (ok(i, m)) v.push_back({i, m});
  }
  for (int i = 0; i < 12; ++i) {
    if (ok(n, m - i)) v.push_back({n, m - i});
    if (ok(n - i, m)) v.push_back({n - i, m});
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  int mm = v.size();
  long long res = 0;
  pair<pair<int, int>, pair<int, int>> ans = {{-1, -1}, {-1, -1}};
  for (int i = 0; i < mm; ++i)
    for (int j = 0; j < mm; ++j)
      for (int k = 0; k < mm; ++k)
        for (int l = 0; l < mm; ++l) {
          if (i == j || i == k || i == l || j == k || j == l || k == l)
            continue;
          long long d1 = dist(v[i].first, v[i].second, v[j].first, v[j].second);
          long long d2 = dist(v[j].first, v[j].second, v[k].first, v[k].second);
          long long d3 = dist(v[k].first, v[k].second, v[l].first, v[l].second);
          if (d1 + d2 + d3 > res) {
            res = d1 + d2 + d3;
            assert(i != k);
            ans = {{i, j}, {k, l}};
          }
        }
  printf("%d %d\n", v[ans.first.first].first, v[ans.first.first].second);
  printf("%d %d\n", v[ans.first.second].first, v[ans.first.second].second);
  printf("%d %d\n", v[ans.second.first].first, v[ans.second.first].second);
  printf("%d %d\n", v[ans.second.second].first, v[ans.second.second].second);
}