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 mod = (int)1e9 + 7;
const int inf = (int)(1e9);
const int N = 100005;
int n, m;
pair<int, int> ind1;
pair<int, int> ind2;
pair<int, int> ind3;
pair<int, int> ind4;
pair<int, int> mas[6];
bool is(int a, int b) {
  if ((a < 0) || (b < 0)) return 0;
  if ((a > n) || (b > m)) return 0;
  if (((a == 0) && (b == 0)) || ((a == n) && (b == m))) return 0;
  return 1;
}
int main() {
  cin >> n >> m;
  mas[0] = make_pair((n), (0));
  mas[1] = make_pair((0), (m));
  mas[2] = make_pair((n - 1), (m));
  mas[3] = make_pair((n), (m - 1));
  mas[4] = make_pair((0), (1));
  mas[5] = make_pair((1), (0));
  double ans = 0;
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= m; ++j) {
      if (is(i, j) == 0) continue;
      double res = 0;
      for (int k = 0; k < 6; ++k) {
        if (is(mas[k].first, mas[k].second) &&
            !(mas[k].first == i && mas[k].second == j))
          res = sqrt((double)((n - i) * (n - i) + (m - j) * (m - j))) +
                sqrt((double)((mas[k].first - i) * (mas[k].first - i) +
                              (mas[k].second - j) * (mas[k].second - j)));
        if (res > ans) {
          ans = res;
          ind3 = make_pair((i), (j));
          ind4 = mas[k];
        }
      }
    }
  }
  double ans1 = 0;
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= m; ++j)
      if (is(i, j))
        if (sqrt((double)(i * i + j * j)) > ans1) {
          ans1 = sqrt((double)(i * i + j * j));
          ind1 = make_pair((i), (j));
        }
  double ans2 = 0;
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= m; ++j)
      if (is(i, j) && !(i == ind1.first && j == ind2.second))
        if (sqrt((double)((n - i) * (n - i) + (m - j) * (m - j))) > ans2) {
          ans2 = sqrt((double)((n - i) * (n - i) + (m - j) * (m - j)));
          ind2 = make_pair((i), (j));
        }
  if (ans >= ans1 + ans2) {
    printf("0 0\n");
    printf("%d %d\n", n, m);
    printf("%d %d\n", ind3.first, ind3.second);
    printf("%d %d\n", ind4.first, ind4.second);
  } else {
    printf("%d %d\n", ind1.first, ind1.second);
    printf("0 0\n");
    printf("%d %d\n", n, m);
    printf("%d %d\n", ind2.first, ind2.second);
  }
  return 0;
}