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;
int n, m;
void push(vector<pair<int, int>> &v, int x, int y) {
  if (x < 0 || y < 0) return;
  if (x > n || y > m) return;
  for (auto &p : v) {
    if (p.first == x && p.second == y) return;
  }
  v.push_back({x, y});
}
double calc(int i, int j, int k, int l, vector<pair<int, int>> &v) {
  if (i == j || i == k || i == l) return 0;
  if (j == k || j == l) return 0;
  if (k == l) return 0;
  double res = 0;
  res += hypot(v[i].first - v[j].first, v[i].second - v[j].second);
  res += hypot(v[j].first - v[k].first, v[j].second - v[k].second);
  res += hypot(v[k].first - v[l].first, v[k].second - v[l].second);
  return res;
}
int main() {
  cin >> n >> m;
  int c = (n + 1) * (m + 1);
  vector<pair<int, int>> p;
  if (c <= 16) {
    for (int i = 0; i <= n; i++)
      for (int j = 0; j <= m; j++) {
        p.push_back({i, j});
      }
  } else {
    push(p, 0, 0);
    push(p, n, 0);
    push(p, 1, 0);
    push(p, 2, 0);
    push(p, n - 2, 0);
    push(p, n - 1, 0);
    push(p, 0, m);
    push(p, n, m);
    push(p, 1, m);
    push(p, 2, m);
    push(p, n - 1, m);
    push(p, n - 2, m);
    push(p, 0, 0);
    push(p, 0, m);
    push(p, 0, 1);
    push(p, 0, 2);
    push(p, 0, m - 1);
    push(p, 0, m - 2);
    push(p, n, 0);
    push(p, n, m);
    push(p, n, 1);
    push(p, n, 2);
    push(p, n, m - 1);
    push(p, n, m - 2);
    c = p.size();
  }
  int I, J, K, L;
  double len = 0;
  for (int i = 0; i < int(c); i++)
    for (int j = 0; j < int(c); j++)
      for (int k = 0; k < int(c); k++)
        for (int l = 0; l < int(c); l++) {
          double tmp = calc(i, j, k, l, p);
          if (tmp > len) {
            len = tmp;
            I = i;
            J = j;
            K = k;
            L = l;
          }
        }
  printf("%d %d\n", p[I].first, p[I].second);
  printf("%d %d\n", p[J].first, p[J].second);
  printf("%d %d\n", p[K].first, p[K].second);
  printf("%d %d\n", p[L].first, p[L].second);
}