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, anis[5], p[5];
int forx[] = {0, 0, 1, 1};
int fory[] = {1, 0, 1, 0};
long double ans;
vector<pair<int, int> > leftt, rightt;
bool valid(int x, int y) {
  if ((x < 0) or (y < 0) or (x > n) or (y > m)) return false;
  return true;
}
bool all_dif() {
  pair<int, int> pp[5];
  pp[0] = leftt[p[1]];
  pp[1] = leftt[p[2]];
  pp[2] = rightt[p[3]];
  pp[3] = rightt[p[4]];
  sort(pp, pp + 4);
  for (int i = 1; i < 4; ++i)
    if (pp[i] == pp[i - 1]) return false;
  return true;
}
long double two_dif(pair<int, int> x, pair<int, int> y) {
  long double foo = (x.first - y.first) * (x.first - y.first);
  foo += (x.second - y.second) * (x.second - y.second);
  foo = sqrt(foo);
  return foo;
}
bool maxi() {
  long double now = 0;
  now += two_dif(leftt[p[1]], rightt[p[3]]);
  now += two_dif(rightt[p[3]], leftt[p[2]]);
  now += two_dif(leftt[p[2]], rightt[p[4]]);
  if (now > ans) {
    ans = now;
    return true;
  }
  return false;
}
int main() {
  cin >> n >> m;
  pair<int, int> help = make_pair(0, 0);
  for (int i = 0; i < 4; ++i)
    if (valid(help.first + forx[i], help.second + fory[i]))
      leftt.push_back(make_pair(help.first + forx[i], help.second + fory[i]));
  help = make_pair(0, m - 1);
  for (int i = 0; i < 4; ++i)
    if (valid(help.first + forx[i], help.second + fory[i]))
      leftt.push_back(make_pair(help.first + forx[i], help.second + fory[i]));
  help = make_pair(n - 1, m - 1);
  for (int i = 0; i < 4; ++i)
    if (valid(help.first + forx[i], help.second + fory[i]))
      rightt.push_back(make_pair(help.first + forx[i], help.second + fory[i]));
  help = make_pair(n - 1, 0);
  for (int i = 0; i < 4; ++i)
    if (valid(help.first + forx[i], help.second + fory[i]))
      rightt.push_back(make_pair(help.first + forx[i], help.second + fory[i]));
  for (int i = leftt.size() - 1; i > -1; --i) leftt.push_back(leftt[i]);
  for (int i = rightt.size() - 1; i > -1; --i) rightt.push_back(rightt[i]);
  int help1 = leftt.size();
  for (int i = 0; i < rightt.size(); ++i) leftt.push_back(rightt[i]);
  for (int i = 0; i < help1; ++i) rightt.push_back(leftt[i]);
  for (p[1] = 0; p[1] < leftt.size(); ++p[1])
    for (p[2] = 0; p[2] < leftt.size(); ++p[2])
      for (p[3] = 0; p[3] < rightt.size(); ++p[3])
        for (p[4] = 0; p[4] < rightt.size(); ++p[4])
          if (all_dif()) {
            if (maxi())
              for (int i = 1; i < 5; ++i) anis[i] = p[i];
          }
  cout << leftt[anis[1]].first << ' ' << leftt[anis[1]].second << endl;
  cout << rightt[anis[3]].first << ' ' << rightt[anis[3]].second << endl;
  cout << leftt[anis[2]].first << ' ' << leftt[anis[2]].second << endl;
  cout << rightt[anis[4]].first << ' ' << rightt[anis[4]].second << endl;
}