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;
set<pair<int, int> > vp;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  if (n == 0) {
    cout << 0 << ' ' << 1 << endl;
    cout << 0 << ' ' << m << endl;
    cout << 0 << ' ' << 0 << endl;
    cout << 0 << ' ' << m - 1 << endl;
    return 0;
  } else if (m == 0) {
    cout << 1 << ' ' << 0 << endl;
    cout << n << ' ' << 0 << endl;
    cout << 0 << ' ' << 0 << endl;
    cout << n - 1 << ' ' << 0 << endl;
    return 0;
  }
  vp.insert(make_pair(n, m));
  vp.insert(make_pair(0, 0));
  vp.insert(make_pair(0, m));
  vp.insert(make_pair(n, 0));
  vp.insert(make_pair(n - 1, m - 1));
  vp.insert(make_pair(1, 1));
  vp.insert(make_pair(n - 1, 1));
  vp.insert(make_pair(1, m - 1));
  vp.insert(make_pair(n - 1, m));
  vp.insert(make_pair(n, m - 1));
  vp.insert(make_pair(0, 1));
  vp.insert(make_pair(1, 0));
  vector<pair<int, int> > num;
  pair<int, int> ans[4];
  double maxi = 0.;
  for (set<pair<int, int> >::iterator x = vp.begin(); x != vp.end(); ++x) {
    for (set<pair<int, int> >::iterator y = vp.begin(); y != vp.end(); ++y) {
      if (y == x) continue;
      for (set<pair<int, int> >::iterator z = vp.begin(); z != vp.end(); ++z) {
        if (z == y || z == x) continue;
        for (set<pair<int, int> >::iterator t = vp.begin(); t != vp.end();
             ++t) {
          if (t == z || t == y || t == x) continue;
          pair<int, int> tmp[4];
          int arr[4] = {0, 1, 2, 3};
          tmp[0].first = x->first;
          tmp[0].second = x->second;
          tmp[1].first = y->first;
          tmp[1].second = y->second;
          tmp[2].first = z->first;
          tmp[2].second = z->second;
          tmp[3].first = t->first;
          tmp[3].second = t->second;
          double dis = 0.;
          do {
            double dis = 0.;
            dis +=
                sqrt((double)((tmp[arr[0]].first - tmp[arr[1]].first) *
                                  (tmp[arr[0]].first - tmp[arr[1]].first) +
                              (tmp[arr[0]].second - tmp[arr[1]].second) *
                                  (tmp[arr[0]].second - tmp[arr[1]].second)));
            dis +=
                sqrt((double)((tmp[arr[1]].first - tmp[arr[2]].first) *
                                  (tmp[arr[1]].first - tmp[arr[2]].first) +
                              (tmp[arr[1]].second - tmp[arr[2]].second) *
                                  (tmp[arr[1]].second - tmp[arr[2]].second)));
            dis +=
                sqrt((double)((tmp[arr[2]].first - tmp[arr[3]].first) *
                                  (tmp[arr[2]].first - tmp[arr[3]].first) +
                              (tmp[arr[2]].second - tmp[arr[3]].second) *
                                  (tmp[arr[2]].second - tmp[arr[3]].second)));
            if (dis > maxi) {
              maxi = dis;
              for (int i = 0; i < 4; i++) ans[i] = tmp[arr[i]];
            }
          } while (next_permutation(arr, arr + 4));
        }
      }
    }
  }
  for (int i = 0; i < 4; i++) {
    cout << ans[i].first << ' ' << ans[i].second << endl;
  }
  return 0;
}