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:16777216")
using namespace std;
double pi = acos((double)-1);
const int MOD = 1000000007;
const int INF = 2147483647;
int EPS_decimals = 7;
double p_EPS = pow(10, EPS_decimals);
double my_round(double d) {
  double res = floor(d * p_EPS + 0.5) / p_EPS;
  return res;
}
double distance(int x1, int y1, int x2, int y2) {
  return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
int main() {
  clock_t tStart = clock();
  int tests = 1;
  for (int test = 1; test <= tests; test++) {
    int n, m;
    cin >> n >> m;
    bool swapped = false;
    if (n < m) {
      swap(n, m);
      swapped = true;
    }
    if (m == 0) {
      if (swapped) {
        cout << m << " " << 1 << endl;
        cout << m << " " << n << endl;
        cout << m << " " << 0 << endl;
        cout << m << " " << n - 1 << endl;
      } else {
        cout << 1 << " " << m << endl;
        cout << n << " " << m << endl;
        cout << 0 << " " << m << endl;
        cout << n - 1 << " " << m << endl;
      }
    } else {
      vector<int> x1, y1, x2, y2;
      y1.push_back(m - 1);
      x1.push_back(0);
      y1.push_back(m);
      x1.push_back(0);
      y1.push_back(m);
      x1.push_back(1);
      y1.push_back(m - 1);
      x1.push_back(1);
      y1.push_back(0);
      x1.push_back(0);
      y2.push_back(1);
      x2.push_back(n);
      y2.push_back(0);
      x2.push_back(n);
      y2.push_back(0);
      x2.push_back(n - 1);
      y2.push_back(1);
      x2.push_back(n - 1);
      y2.push_back(m);
      x2.push_back(n);
      for (int i = 0; i < y1.size(); i++) {
        for (int j = i + 1; j < y1.size();) {
          if (x1[i] == x1[j] && y1[i] == y1[j]) {
            x1.erase(x1.begin() + j);
            y1.erase(y1.begin() + j);
          } else {
            j++;
          }
        }
      }
      for (int i = 0; i < y2.size(); i++) {
        for (int j = i + 1; j < y2.size();) {
          if (x2[i] == x2[j] && y2[i] == y2[j]) {
            x2.erase(x2.begin() + j);
            y2.erase(y2.begin() + j);
          } else {
            j++;
          }
        }
      }
      double best_dist = -1;
      int best_i, best_j, best_k, best_l;
      for (int i = 0; i < x1.size(); i++) {
        for (int j = 0; j < x2.size(); j++) {
          for (int k = 0; k < x1.size(); k++) {
            if (k == i) continue;
            for (int l = 0; l < x2.size(); l++) {
              if (l == j) continue;
              double dist1 = distance(x1[i], y1[i], x2[j], y2[j]);
              double dist2 = distance(x2[j], y2[j], x1[k], y1[k]);
              double dist3 = distance(x1[k], y1[k], x2[l], y2[l]);
              double dist = my_round(dist1 + dist2 + dist3);
              if (dist > best_dist) {
                best_dist = dist;
                best_i = i;
                best_j = j;
                best_k = k;
                best_l = l;
              }
            }
          }
        }
      }
      if (swapped) {
        swap(x1, y1);
        swap(x2, y2);
      }
      cout << x1[best_i] << " " << y1[best_i] << endl;
      cout << x2[best_j] << " " << y2[best_j] << endl;
      cout << x1[best_k] << " " << y1[best_k] << endl;
      cout << x2[best_l] << " " << y2[best_l] << endl;
    }
  }
}