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 double eps = 1e-9;
struct point {
  int x, y;
  point() {}
  point(int a, int b) {
    x = a;
    y = b;
  }
  friend bool operator<(point a, point b) {
    if (a.x != b.x) return a.x < b.x;
    return a.y < b.y;
  }
  friend bool operator==(point a, point b) {
    return (a.x == b.x) && a.y == b.y;
  }
};
double dist(point a, point b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
int n, m;
vector<point> v;
int main() {
  scanf("%d %d", &n, &m);
  if (n == 1 && m == 1) {
    printf("1 1\n0 0\n1 0\n0 1\n");
    return 0;
  }
  v.push_back(point(0, 0));
  v.push_back(point(1, 0));
  v.push_back(point(0, 1));
  v.push_back(point(n, m));
  v.push_back(point(n - 1, m));
  v.push_back(point(n, m - 1));
  v.push_back(point(0, m));
  v.push_back(point(n, 0));
  for (int i = (0); i < int(5); ++i)
    for (int j = (0); j < int(5); ++j) v.push_back(point(n - i, m - j));
  for (int i = 0; i < (int)v.size(); i++)
    if (v[i].x > n || v[i].y > m || v[i].x < 0 || v[i].y < 0) {
      v.erase(v.begin() + i);
      i--;
    }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  int N = (int)v.size();
  double sol = -1;
  vector<int> best;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      for (int k = 0; k < N; k++) {
        for (int t = 0; t < N; t++) {
          if (sol + eps <
              dist(v[i], v[j]) + dist(v[j], v[k]) + dist(v[k], v[t])) {
            if (i == j || i == k || i == t || j == k || j == t || k == t)
              continue;
            sol = dist(v[i], v[j]) + dist(v[j], v[k]) + dist(v[k], v[t]);
            best.clear();
            best.push_back(i);
            best.push_back(j);
            best.push_back(k);
            best.push_back(t);
          }
        }
      }
    }
  }
  for (int i = 0; i < 4; i++) printf("%d %d\n", v[best[i]].x, v[best[i]].y);
  return 0;
}