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>
#pragma comment(linker, "/STACK:20000000")
using namespace std;
int ri() {
  int x;
  scanf("%d", &x);
  return x;
}
long long rll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
void solve() {
  int n = ri(), m = ri();
  if (n == 0 || m == 0) {
    if (n == 0) {
      cout << 0 << " " << 1 << endl;
      cout << 0 << " " << m << endl;
      cout << 0 << " " << 0 << endl;
      cout << 0 << " " << m - 1 << endl;
    } else {
      cout << 1 << " 0" << endl;
      cout << n << " 0" << endl;
      cout << 0 << " 0" << endl;
      cout << n - 1 << " 0" << endl;
    }
    return;
  }
  vector<pair<int, int> > mas;
  mas.push_back(make_pair(0, 0));
  mas.push_back(make_pair(0, m));
  mas.push_back(make_pair(n, 0));
  mas.push_back(make_pair(n, m));
  vector<pair<int, int> > res;
  double best = -1.0;
  do {
    double dist = 0.0;
    for (int j = 0; j <= 2; j++)
      dist += sqrt((mas[j + 1].first - mas[j].first) *
                       (mas[j + 1].first - mas[j].first) +
                   (mas[j + 1].second - mas[j].second) *
                       (mas[j + 1].second - mas[j].second) +
                   0.0);
    if (dist > best) res = mas, best = dist;
    ;
  } while (next_permutation(mas.begin(), mas.end()));
  sort(mas.begin(), mas.end());
  vector<pair<int, int> > wtf = mas;
  if (n >= 2 && m >= 2) {
    for (int i = (int)(0); i <= (int)(3); i++)
      for (int T = (int)(i + 1); T <= (int)(3); T++) {
        vector<pair<int, int> > omga, omgb;
        pair<int, int> a = wtf[i];
        pair<int, int> b = wtf[T];
        pair<int, int> aa = make_pair(a.first + 1, a.second);
        pair<int, int> ab = make_pair(a.first - 1, a.second);
        pair<int, int> ac = make_pair(a.first, a.second + 1);
        pair<int, int> ad = make_pair(a.first, a.second - 1);
        pair<int, int> ba = make_pair(b.first + 1, b.second);
        pair<int, int> bb = make_pair(b.first - 1, b.second);
        pair<int, int> bc = make_pair(b.first, b.second + 1);
        pair<int, int> bd = make_pair(b.first, b.second - 1);
        omga.push_back(aa), omga.push_back(ab), omga.push_back(ac),
            omga.push_back(ad);
        omgb.push_back(ba), omgb.push_back(bb), omgb.push_back(bc),
            omgb.push_back(bd);
        for (int k = (int)(0); k <= (int)(3); k++)
          for (int t = (int)(0); t <= (int)(3); t++) {
            mas.clear();
            mas.push_back(a);
            mas.push_back(b);
            mas.push_back(omga[k]);
            mas.push_back(omgb[t]);
            sort(mas.begin(), mas.end());
            bool check = true;
            for (int j = (int)(0); j <= (int)(3); j++)
              if (mas[j].first < 0 || mas[j].first > n)
                check = false;
              else if (mas[j].second < 0 || mas[j].second > m)
                check = false;
            if (!check) continue;
            do {
              double dist = 0.0;
              for (int j = 0; j <= 2; j++)
                dist += sqrt((mas[j + 1].first - mas[j].first) *
                                 (mas[j + 1].first - mas[j].first) +
                             (mas[j + 1].second - mas[j].second) *
                                 (mas[j + 1].second - mas[j].second) +
                             0.0);
              if (dist > best) res = mas, best = dist;
              ;
            } while (next_permutation(mas.begin(), mas.end()));
          }
      }
  }
  for (int i = 0; i < 4; i++)
    cout << res[i].first << " " << res[i].second << endl;
}
int main() {
  solve();
  return 0;
}