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;
struct Point {
  long long x, y;
  Point(long long a = 0.0, long long b = 0.0) {
    x = a;
    y = b;
  }
  Point operator+(const Point& a) const { return Point(x + a.x, y + a.y); }
  Point operator-(const Point& a) const { return Point(x - a.x, y - a.y); }
  Point operator*(const long long& a) const { return Point(x * a, y * a); }
  Point operator/(const long long& a) const { return Point(x / a, y / a); }
  long long operator*(const Point& a) const { return x * a.y - y * a.x; }
  double operator/(const Point& a) const {
    return sqrt((a.x - x) * (a.x - x) + (a.y - y) * (a.y - y));
  }
  long long operator%(const Point& a) const { return x * a.x + y * a.y; }
  bool operator==(const Point& a) const { return a.x == x && a.y == y; }
} lib[5000];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  double ans = 0;
  Point p[6], fin[6];
  p[0] = Point(0, 0);
  p[1] = Point(n, m);
  int c = 0;
  for (int i = 0; i <= n; i++) lib[c++] = Point(i, 0);
  for (int i = 1; i <= m; i++) lib[c++] = Point(n, i);
  for (int i = n - 1; i >= 0; i--) lib[c++] = Point(i, m);
  for (int i = m - 1; i > 0; i--) lib[c++] = Point(0, i);
  for (int i = 0; i < c; i++)
    for (int j = 0; j < c; j++) {
      int g = 0;
      p[2] = lib[i];
      p[3] = lib[j];
      if (p[3] == p[0]) g = 1;
      if (p[3] == p[1]) g = 1;
      if (p[2] == p[0]) g = 1;
      if (p[2] == p[1]) g = 1;
      if (p[3] == p[2]) g = 1;
      if (g == 0) {
        double t = 0;
        t = (p[0] / p[1]) + (p[1] / p[2]) + (p[2] / p[3]);
        if (t > ans) {
          ans = t;
          fin[0] = p[0];
          fin[1] = p[1];
          fin[2] = p[2];
          fin[3] = p[3];
        }
        t = (p[0] / p[1]) + (p[1] / p[2]) + (p[0] / p[3]);
        if (t > ans) {
          ans = t;
          fin[0] = p[2];
          fin[1] = p[1];
          fin[2] = p[0];
          fin[3] = p[3];
        }
        t = (p[0] / p[1]) + (p[1] / p[3]) + (p[0] / p[2]);
        if (t > ans) {
          ans = t;
          fin[0] = p[3];
          fin[1] = p[1];
          fin[2] = p[0];
          fin[3] = p[2];
        }
      }
    }
  for (int i = 0; i < 4; i++) printf("%I64d %I64d\n", fin[i].x, fin[i].y);
  return 0;
}