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 int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
int n, m;
inline bool check(int x, int y) { return 0 <= x && x <= n && 0 <= y && y <= m; }
inline double dist(int x1, int y1, int x2, int y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  vector<pair<int, int> > tr, q;
  tr.push_back(make_pair(0, 0));
  tr.push_back(make_pair(n, m));
  tr.push_back(make_pair(n, 0));
  tr.push_back(make_pair(0, m));
  for (auto it : tr) {
    q.push_back(it);
    for (int i = 0; i < 4; i++) {
      int x = it.first + dx[i], y = it.second + dy[i];
      if (check(x, y)) {
        q.push_back(make_pair(x, y));
      }
    }
  }
  double ans = 0;
  pair<int, int> ans1, ans2, ans3, ans4;
  for (int i = 0; i < (int)q.size(); i++) {
    for (int j = 0; j < (int)q.size(); j++) {
      for (int k = 0; k < (int)q.size(); k++) {
        for (int l = 0; l < (int)q.size(); l++) {
          set<pair<int, int> > s;
          s.insert(q[i]);
          s.insert(q[j]);
          s.insert(q[k]);
          s.insert(q[l]);
          if ((int)s.size() != 4) {
            continue;
          }
          double val = 0;
          val += dist(q[i].first, q[i].second, q[j].first, q[j].second);
          val += dist(q[j].first, q[j].second, q[k].first, q[k].second);
          val += dist(q[k].first, q[k].second, q[l].first, q[l].second);
          if (val > ans) {
            ans = val;
            ans1 = q[i];
            ans2 = q[j];
            ans3 = q[k];
            ans4 = q[l];
          }
        }
      }
    }
  }
  cout << ans1.first << " " << ans1.second << "\n";
  cout << ans2.first << " " << ans2.second << "\n";
  cout << ans3.first << " " << ans3.second << "\n";
  cout << ans4.first << " " << ans4.second << "\n";
}