#include <bits/stdc++.h>
using namespace std;
const int Mod = 998244353;
int dcmp(double x) {
  if (fabs(x) <= 1e-7) return 0;
  return x < 0 ? -1 : 1;
}
struct Point {
  long long x, y;
  Point() {}
  Point(long long x, long long y) : x(x), y(y) {}
  Point operator-(const Point &a) const { return Point(x - a.x, y - a.y); }
  Point operator+(const Point &a) const { return Point(x + a.x, y + a.y); }
  Point operator*(const double &a) const { return Point(x * a, y * a); }
  bool operator<(const Point &a) const {
    if (x == a.x) return y < a.y;
    return x < a.x;
  }
  bool operator==(const Point &a) const { return x == a.x && y == a.y; }
};
struct cycle {
  Point p;
  long long r;
  cycle() {}
  cycle(Point p, long long r) : p(p), r(r) {}
};
struct Line {
  Point p;
  Point v;
  double ang;
  Line() {}
  Line(Point p, Point v) : p(p), v(v) { ang = atan2(v.y, v.x); }
  bool operator<(const Line &l) const { return ang < l.ang; }
};
long long Cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
double Dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
long long dis(Point a) { return Dot(a, a); }
double dist(Point p, Point a, Point b) {
  Point v1 = b - a, v2 = p - a, v3 = p - b;
  if (Dot(v1, v2) < 0) return dis(v2);
  if (Dot(v1, v3) > 0) return dis(v3);
  return fabs(Cross(a - p, b - p)) / dis(a - b);
}
bool chk(Point p, double r, Point q, double rr, double RR) {
  double diss = dis(p - q);
  if (dcmp(RR + r - diss) <= 0) return 1;
  if (dcmp(rr - r - diss) >= 0) return 1;
  if (dcmp(r - RR - diss) >= 0) return 1;
  return 0;
}
vector<Point> vp;
int n, m;
void solve() {
  cin >> n >> m;
  vp.push_back(Point(0, 0));
  vp.push_back(Point(n, m));
  vp.push_back(Point(max(0, n - 1), m));
  vp.push_back(Point(max(0, n - 1), 0));
  vp.push_back(Point(n, max(m - 1, 0)));
  vp.push_back(Point(0, max(m - 1, 0)));
  vp.push_back(Point(0, m));
  vp.push_back(Point(n, 0));
  vp.push_back(Point(min(1, n), 0));
  vp.push_back(Point(min(1, n), m));
  vp.push_back(Point(0, min(1, m)));
  vp.push_back(Point(n, min(1, m)));
  sort(vp.begin(), vp.end());
  int cnt = unique(vp.begin(), vp.end()) - vp.begin();
  long long ans = 0;
  int x1, x2, x3, x4;
  for (int i = 0; i <= cnt - 1; i++) {
    for (int j = 0; j <= cnt - 1; j++) {
      for (int k = 0; k <= cnt - 1; k++) {
        for (int l = 0; l <= cnt - 1; l++) {
          if (i == j || i == k || i == l || j == k || j == l || k == l)
            continue;
          long long crt =
              dis(vp[i] - vp[j]) + dis(vp[j] - vp[k]) + dis(vp[k] - vp[l]);
          if (crt > ans) {
            ans = crt;
            x1 = i;
            x2 = j;
            x3 = k;
            x4 = l;
          }
        }
      }
    }
  }
  cout << vp[x1].x << " " << vp[x1].y << endl;
  cout << vp[x2].x << " " << vp[x2].y << endl;
  cout << vp[x3].x << " " << vp[x3].y << endl;
  cout << vp[x4].x << " " << vp[x4].y << endl;
}
int main() {
  solve();
  return 0;
}

### Prompt

Please create a solution in Cpp to the following 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

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int Mod = 998244353;
int dcmp(double x) {
  if (fabs(x) <= 1e-7) return 0;
  return x < 0 ? -1 : 1;
}
struct Point {
  long long x, y;
  Point() {}
  Point(long long x, long long y) : x(x), y(y) {}
  Point operator-(const Point &a) const { return Point(x - a.x, y - a.y); }
  Point operator+(const Point &a) const { return Point(x + a.x, y + a.y); }
  Point operator*(const double &a) const { return Point(x * a, y * a); }
  bool operator<(const Point &a) const {
    if (x == a.x) return y < a.y;
    return x < a.x;
  }
  bool operator==(const Point &a) const { return x == a.x && y == a.y; }
};
struct cycle {
  Point p;
  long long r;
  cycle() {}
  cycle(Point p, long long r) : p(p), r(r) {}
};
struct Line {
  Point p;
  Point v;
  double ang;
  Line() {}
  Line(Point p, Point v) : p(p), v(v) { ang = atan2(v.y, v.x); }
  bool operator<(const Line &l) const { return ang < l.ang; }
};
long long Cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
double Dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
long long dis(Point a) { return Dot(a, a); }
double dist(Point p, Point a, Point b) {
  Point v1 = b - a, v2 = p - a, v3 = p - b;
  if (Dot(v1, v2) < 0) return dis(v2);
  if (Dot(v1, v3) > 0) return dis(v3);
  return fabs(Cross(a - p, b - p)) / dis(a - b);
}
bool chk(Point p, double r, Point q, double rr, double RR) {
  double diss = dis(p - q);
  if (dcmp(RR + r - diss) <= 0) return 1;
  if (dcmp(rr - r - diss) >= 0) return 1;
  if (dcmp(r - RR - diss) >= 0) return 1;
  return 0;
}
vector<Point> vp;
int n, m;
void solve() {
  cin >> n >> m;
  vp.push_back(Point(0, 0));
  vp.push_back(Point(n, m));
  vp.push_back(Point(max(0, n - 1), m));
  vp.push_back(Point(max(0, n - 1), 0));
  vp.push_back(Point(n, max(m - 1, 0)));
  vp.push_back(Point(0, max(m - 1, 0)));
  vp.push_back(Point(0, m));
  vp.push_back(Point(n, 0));
  vp.push_back(Point(min(1, n), 0));
  vp.push_back(Point(min(1, n), m));
  vp.push_back(Point(0, min(1, m)));
  vp.push_back(Point(n, min(1, m)));
  sort(vp.begin(), vp.end());
  int cnt = unique(vp.begin(), vp.end()) - vp.begin();
  long long ans = 0;
  int x1, x2, x3, x4;
  for (int i = 0; i <= cnt - 1; i++) {
    for (int j = 0; j <= cnt - 1; j++) {
      for (int k = 0; k <= cnt - 1; k++) {
        for (int l = 0; l <= cnt - 1; l++) {
          if (i == j || i == k || i == l || j == k || j == l || k == l)
            continue;
          long long crt =
              dis(vp[i] - vp[j]) + dis(vp[j] - vp[k]) + dis(vp[k] - vp[l]);
          if (crt > ans) {
            ans = crt;
            x1 = i;
            x2 = j;
            x3 = k;
            x4 = l;
          }
        }
      }
    }
  }
  cout << vp[x1].x << " " << vp[x1].y << endl;
  cout << vp[x2].x << " " << vp[x2].y << endl;
  cout << vp[x3].x << " " << vp[x3].y << endl;
  cout << vp[x4].x << " " << vp[x4].y << endl;
}
int main() {
  solve();
  return 0;
}

```