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 maxN = 1000 + 10;
struct node {
  int x, y;
  node() {}
  node(int _x, int _y) : x(_x), y(_y) {}
};
node p[maxN << 1], q[maxN << 1];
int np, nq;
double dist(node s, node t) { return 1e10 * hypot(s.x - t.x, s.y - t.y); }
int main() {
  int n, m;
  cin >> n >> m;
  if (n == 0) {
    cout << 0 << " " << 1 << endl;
    cout << 0 << " " << m << endl;
    cout << 0 << " " << 0 << endl;
    cout << 0 << " " << (m - 1) << endl;
    return 0;
  }
  if (m == 0) {
    cout << 1 << " " << 0 << endl;
    cout << n << " " << 0 << endl;
    cout << 0 << " " << 0 << endl;
    cout << (n - 1) << " " << 0 << endl;
    return 0;
  }
  np = 0;
  for (int x = 1; x <= n; x++) {
    if (!(x <= 10 || x + 10 >= n)) continue;
    p[np].x = x;
    p[np].y = 0;
    np++;
  }
  for (int y = 1; y < m; y++) {
    if (!(y <= 10 || y + 10 >= m)) continue;
    p[np].x = n;
    p[np].y = y;
    np++;
  }
  nq = 0;
  for (int x = n - 1; x >= 0; x--) {
    if (!(x <= 10 || x + 10 >= n)) continue;
    q[nq].x = x;
    q[nq].y = m;
    nq++;
  }
  for (int y = m - 1; y > 0; y--) {
    if (!(y <= 10 || y + 10 >= m)) continue;
    q[nq].x = 0;
    q[nq].y = y;
    nq++;
  }
  node a = node(0, 0);
  node b = node(n, m);
  node c, d, p1, p2, p3, p4;
  double res = -1.0, tmp;
  int i, j;
  double based = dist(a, b);
  for (i = 0; i < np; i++) {
    for (j = 0; j < nq; j++) {
      c = p[i], d = q[j];
      tmp = based + dist(a, c) + dist(c, d);
      if (tmp > res) {
        res = tmp;
        p1 = b;
        p2 = a;
        p3 = c;
        p4 = d;
      }
      tmp = based + dist(b, c) + dist(c, d);
      if (tmp > res) {
        res = tmp;
        p1 = a;
        p2 = b;
        p3 = c;
        p4 = d;
      }
      tmp = based + dist(a, d) + dist(d, c);
      if (tmp > res) {
        res = tmp;
        p1 = b;
        p2 = a;
        p3 = d;
        p4 = c;
      }
      tmp = based + dist(b, d) + dist(d, c);
      if (tmp > res) {
        res = tmp;
        p1 = a;
        p2 = b;
        p3 = d;
        p4 = c;
      }
      tmp = based + dist(a, c) + dist(b, d);
      if (tmp > res) {
        res = tmp;
        p1 = c;
        p2 = a;
        p3 = b;
        p4 = d;
      }
      tmp = based + dist(c, b) + dist(a, d);
      if (tmp > res) {
        res = tmp;
        p1 = c;
        p2 = b;
        p3 = a;
        p4 = d;
      }
    }
  }
  cout << p1.x << " " << p1.y << endl;
  cout << p2.x << " " << p2.y << endl;
  cout << p3.x << " " << p3.y << endl;
  cout << p4.x << " " << p4.y << endl;
  return 0;
}