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>
const int INF = 1e9;
using namespace std;
void printAns(bool isSwap, vector<pair<int, int> >& ans) {
  for (int i = 0; i < ans.size(); i++) {
    int x = ans[i].first;
    int y = ans[i].second;
    if (isSwap) {
      swap(x, y);
    }
    cout << x << " " << y << endl;
  }
}
int main() {
  int n, m;
  while (cin >> n >> m) {
    bool isSwap = n < m;
    if (isSwap) {
      swap(n, m);
    }
    if (false && m == 0) {
      vector<pair<int, int> > ans;
      ans.push_back(make_pair(1, 0));
      ans.push_back(make_pair(n, 0));
      ans.push_back(make_pair(0, 0));
      ans.push_back(make_pair(n - 1, 0));
      printAns(isSwap, ans);
      continue;
    }
    double best = 0;
    vector<pair<int, int> > bestAns;
    bestAns.push_back(make_pair(0, 0));
    bestAns.push_back(make_pair(0, 0));
    bestAns.push_back(make_pair(n, m));
    bestAns.push_back(make_pair(n, m));
    for (int i = 1; i < 2 * n + 2 * m; i++) {
      if (i == n + m) {
        continue;
      }
      int x1, y1;
      if (i < n + m) {
        x1 = max(0, i - m);
        y1 = min(i, m);
      } else {
        x1 = min(i - n - m, n);
        y1 = max(0, i - n - n - m);
      }
      double s1 = sqrt(1. * (n - x1) * (n - x1) + 1. * (m - y1) * (m - y1));
      for (int j = 1; j < 2 * n + 2 * m; j++) {
        if (j == n + m) {
          continue;
        }
        int x2, y2;
        if (j < n + m) {
          x2 = max(0, j - m);
          y2 = min(j, m);
        } else {
          x2 = min(j - n - m, n);
          y2 = max(0, j - n - n - m);
        }
        if (x2 == x1 && y2 == y1) {
          continue;
        }
        double s2 =
            sqrt(1. * (x2 - x1) * (x2 - x1) + 1. * (y2 - y1) * (y2 - y1));
        if (s1 + s2 > best) {
          best = s1 + s2;
          bestAns[0] = make_pair(0, 0);
          bestAns[1] = make_pair(n, m);
          bestAns[2] = make_pair(x1, y1);
          bestAns[3] = make_pair(x2, y2);
        }
        double s3 = sqrt(1. * (x2) * (x2) + 1. * (y2) * (y2));
        if (s1 + s3 > best) {
          best = s1 + s3;
          bestAns[0] = make_pair(x2, y2);
          bestAns[1] = make_pair(0, 0);
          bestAns[2] = make_pair(n, m);
          bestAns[3] = make_pair(x1, y1);
        }
      }
    }
    printAns(isSwap, bestAns);
  }
  return 0;
}