#include <bits/stdc++.h>
using namespace std;
void RD(int &x) { scanf("%d", &x); }
void RD(unsigned int &x) { scanf("%u", &x); }
void RD(double &x) { scanf("%lf", &x); }
void RD(int &x, int &y) { scanf("%d%d", &x, &y); }
void RD(unsigned int &x, unsigned int &y) { scanf("%u%u", &x, &y); }
void RD(double &x, double &y) { scanf("%lf%lf", &x, &y); }
void RD(int &x, int &y, int &z) { scanf("%d%d%d", &x, &y, &z); }
void RD(unsigned int &x, unsigned int &y, unsigned int &z) {
  scanf("%u%u%u", &x, &y, &z);
}
void RD(double &x, double &y, double &z) { scanf("%lf%lf%lf", &x, &y, &z); }
void RD(char &x) { x = getchar(); }
void RD(char *s) { scanf("%s", s); }
void RD(string &s) { cin >> s; }
void PR(int x) { printf("%d\n", x); }
void PR(int x, int y) { printf("%d %d\n", x, y); }
void PR(unsigned int x) { printf("%u\n", x); }
void PR(unsigned long long x) { cout << x << endl; }
void PR(double x) { printf("%.4lf\n", x); }
void PR(char x) { printf("%c\n", x); }
void PR(char *x) { printf("%s\n", x); }
void PR(string x) { cout << x << endl; }
void PR(long long x) { cout << x << endl; }
void upMin(int &x, int y) {
  if (x > y) x = y;
}
void upMin(long long &x, long long y) {
  if (x > y) x = y;
}
void upMin(double &x, double y) {
  if (x > y) x = y;
}
void upMax(int &x, int y) {
  if (x < y) x = y;
}
void upMax(long long &x, long long y) {
  if (x < y) x = y;
}
void upMax(double &x, double y) {
  if (x < y) x = y;
}
int sgn(double x) {
  if (x > 1e-8) return 1;
  if (x < -1e-8) return -1;
  return 0;
}
long long Gcd(long long x, long long y) {
  if (x < 0) x = -x;
  if (y < 0) y = -y;
  if (y == 0) return x;
  return Gcd(y, x % y);
}
long long Lcm(long long x, long long y) { return x / Gcd(x, y) * y; }
long long eular(long long n) {
  long long ans = n, i;
  for (i = 2; i * i <= n; i++)
    if (n % i == 0) {
      ans -= ans / i;
      while (n % i == 0) n /= i;
    }
  if (n > 1) ans -= ans / n;
  return ans;
}
long long exGcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long temp = exGcd(b, a % b, x, y);
  long long t = x;
  x = y;
  y = t - a / b * y;
  return temp;
}
long long gcdReverse(long long a, long long b) {
  long long x, y;
  long long g = exGcd(a, b, x, y);
  if (g != 1) return 0;
  x %= b;
  if (x < 0) x += b;
  return x;
}
long long myPow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a;
    a = a * a;
    b >>= 1;
  }
  return ans;
}
long long myPow(long long a, long long b, long long mod) {
  a %= mod;
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long getInt() {
  long long x = 0, flag = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') {
    flag = -1, c = getchar();
    while (!isdigit(c)) c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * flag;
}
long long getSqrt(long long t) {
  long long p = sqrt(1.0 * t);
  while (p * p > t) p--;
  while ((p + 1) <= t / (p + 1)) p++;
  return p;
}
struct point {
  double x, y;
  point() {}
  point(double _x, double _y) {
    x = _x;
    y = _y;
  }
  void get() { scanf("%lf%lf", &x, &y); }
  point operator+(point a) { return point(x + a.x, y + a.y); }
  point operator-(point a) { return point(x - a.x, y - a.y); }
  point operator*(double t) { return point(x * t, y * t); }
  double operator*(point a) { return x * a.y - y * a.x; }
  double operator^(point a) { return x * a.x + y * a.y; }
  double Len() { return sqrt(x * x + y * y); }
  point adjustTo(double L) {
    L /= Len();
    return point(x * L, y * L);
  }
  point operator/(double t) { return point(x / t, y / t); }
  double rotateAngle(point a) {
    point p = *this;
    return atan2(p * a, p ^ a);
  }
  int operator==(point a) { return sgn(x - a.x) == 0 && sgn(y - a.y) == 0; }
  point zhuanNi(double ang) {
    return point(x * cos(ang) - y * sin(ang), x * sin(ang) + y * cos(ang));
  }
  point zhuanShun(double ang) {
    return point(x * cos(ang) + y * sin(ang), -x * sin(ang) + y * cos(ang));
  }
  void print() { printf("%.4lf %.4lf\n", x, y); }
};
double calPloyArea(point a[], int n) {
  double ans = 0;
  int i;
  for (i = 0; i < n; i++) ans += a[i] * a[(i + 1) % n];
  return ans;
}
int changeToClockwise(point a[], int n) {
  double s = calPloyArea(a, n);
  if (sgn(s) >= 0) return 0;
  int L = 0, R = n - 1;
  while (L < R) swap(a[L++], a[R--]);
  return 1;
}
int pointOnSeg(point p, point a, point b) {
  if (sgn((p - a) * (p - b))) return 0;
  int x = sgn((p.x - a.x) * (p.x - b.x));
  int y = sgn((p.y - a.y) * (p.y - b.y));
  return x <= 0 && y <= 0;
}
int pointOnRightOfLine(point p, point a, point b) {
  return sgn((p - a) * (b - a)) > 0;
}
int pointOnLine(point p, point a, point b) {
  return sgn((p - a) * (b - a)) == 0;
}
int pointOnLeftOfLine(point p, point a, point b) {
  return sgn((b - a) * (p - a)) > 0;
}
int getRelationOfPointAndPloy(point a[], int n, point p) {
  a[n] = a[0];
  int i;
  double sum = 0;
  for (i = 0; i < n; i++) {
    if (pointOnSeg(p, a[i], a[i + 1])) return 0;
    point aa = a[i] - p;
    point bb = a[i + 1] - p;
    sum += aa.rotateAngle(bb);
  }
  if (fabs(sum - 2 * acos(-1.0)) < 1e-2) return -1;
  return 1;
}
int isParal(point a, point b, point p, point q) {
  double aa = (b.x - a.x) * (p.y - q.y);
  double bb = (b.y - a.y) * (p.x - q.x);
  return sgn(aa - bb) == 0;
}
int lineCrossLine(point a, point b, point p, point q, point &ans) {
  if (isParal(a, b, p, q)) {
    if (!pointOnLine(p, a, b)) return 0;
    return 2;
  }
  double s1 = (p - a) * (q - a);
  double s2 = (q - b) * (p - b);
  ans = (a * s2 + b * s1) / (s1 + s2);
  return 1;
}
int segCrossSeg(point a, point b, point p, point q, point &ans) {
  if (isParal(a, b, p, q)) {
    if (!pointOnLine(p, a, b)) return 0;
    if (sgn(a.x - b.x) == 0) {
      if (p.y > q.y) swap(p, q);
      if (a.y > b.y) swap(a, b);
      if (sgn(q.y - a.y) == -1 || sgn(b.y - p.y) == -1) return 0;
      if (q == a || p == b) {
        if (q == a) ans = q;
        if (p == b) ans = p;
        return 1;
      }
      return 2;
    }
    if (p.x > q.x) swap(p, q);
    if (a.x > b.x) swap(a, b);
    if (sgn(q.x - a.x) == -1 || sgn(b.x - p.x) == -1) return 0;
    if (q == a || p == b) {
      if (q == a) ans = q;
      if (p == b) ans = p;
      return 1;
    }
    return 2;
  }
  lineCrossLine(a, b, p, q, ans);
  if (pointOnSeg(ans, a, b) && pointOnSeg(ans, p, q)) return 1;
  return 0;
}
const long long MM = 1000000000000LL;
struct BigInteger {
  long long a[105];
  int cnt;
  BigInteger() {
    cnt = 1;
    a[1] = 0;
  }
  BigInteger(long long x) {
    if (x == 0) {
      cnt = 1;
      a[1] = 0;
      return;
    }
    cnt = 1;
    a[1] = x;
  }
  BigInteger operator*(int x) {
    BigInteger p = *this;
    int i;
    for (i = 1; i <= p.cnt; i++) p.a[i] *= x;
    int t = 0;
    for (i = 1; i <= p.cnt; i++) {
      p.a[i] += t;
      t = p.a[i] / MM;
      p.a[i] %= MM;
    }
    if (t == 0) return p;
    while (t) p.a[++p.cnt] = t % MM, t /= MM;
    return p;
  }
  int zero() { return cnt == 1 && a[1] == 0; }
  BigInteger operator+(BigInteger a) {
    BigInteger p, q;
    if (a.cnt > cnt)
      p = a, q = *this;
    else
      p = *this, q = a;
    int i;
    for (i = 1; i <= q.cnt; i++) p.a[i] += q.a[i];
    int re = 0;
    for (i = 1; i <= p.cnt; i++) {
      p.a[i] += re;
      re = p.a[i] / MM;
      p.a[i] %= MM;
    }
    if (re) {
      p.a[++p.cnt] = re;
    }
    return p;
  }
};
struct fraction {
  long long a, b;
  fraction() {
    a = 0;
    b = 1;
  }
  fraction(long long x) {
    a = x;
    b = 1;
  }
  fraction(long long x, long long y) {
    a = x;
    b = y;
    deal();
  }
  void deal() {
    if (b < 0) b = -b, a = -a;
    long long k = Gcd(a, b);
    if (k < 0) k = -k;
    a /= k;
    b /= k;
  }
  fraction operator+(fraction p) {
    fraction ans;
    ans.b = Lcm(b, p.b);
    ans.a = ans.b / b * a + ans.b / p.b * p.a;
    ans.deal();
    return ans;
  }
  fraction operator-(fraction p) {
    fraction ans;
    ans.b = Lcm(b, p.b);
    ans.a = ans.b / b * a - ans.b / p.b * p.a;
    ans.deal();
    return ans;
  }
  fraction operator*(fraction p) {
    fraction ans;
    ans.a = a * p.a;
    ans.b = b * p.b;
    ans.deal();
    return ans;
  }
  fraction operator/(fraction p) {
    fraction ans;
    ans.a = a * p.b;
    ans.b = b * p.a;
    ans.deal();
    return ans;
  }
  int operator==(fraction p) { return a * p.b == b * p.a; }
  int operator!=(fraction p) {
    if ((*this) == p) return 0;
    return 1;
  }
  int isZero() { return a == 0; }
};
const int matrixSize = 3;
int matrixMod;
struct Matrix {
  long long a[3][3];
  void init(int t = 0) {
    int i, j;
    for (i = 0; i < matrixSize; i++)
      for (j = 0; j < matrixSize; j++) a[i][j] = 0;
    if (t) {
      for (i = 0; i < matrixSize; i++) a[i][i] = 1;
    }
  }
  Matrix operator*(Matrix p) {
    Matrix ans;
    ans.init();
    int i, j, k;
    int x = matrixSize;
    for (k = 0; k < x; k++)
      for (i = 0; i < x; i++)
        for (j = 0; j < x; j++) {
          ans.a[i][j] += a[i][k] * p.a[k][j] % matrixMod;
          ans.a[i][j] %= matrixMod;
        }
    return ans;
  }
  Matrix pow(long long t) {
    Matrix p = *this, ans;
    ans.init(1);
    while (t) {
      if (t & 1) ans = ans * p;
      p = p * p;
      t >>= 1;
    }
    return ans;
  }
  void print() {
    int i, j;
    for (i = 0; i < matrixSize; i++) {
      for (j = 0; j < matrixSize; j++) cout << a[i][j] << ' ';
      puts("");
    }
  }
};
const int mod = 1000000007;
const long long inf = (((long long)1) << 61) + 5;
const double dinf = 1000000000;
const int INF = 2000000005;
const int N = 1111111;
int n, m;
int cross(pair<int, int> a, pair<int, int> b, pair<int, int> p) {
  b.first -= a.first;
  b.second -= a.second;
  p.first -= a.first;
  p.second -= a.second;
  int x = b.first * p.second - b.second * p.first;
  if (x < 0) return -1;
  if (x > 0) return 1;
  return 0;
}
int ok(pair<int, int> a, pair<int, int> b, pair<int, int> c, pair<int, int> d) {
  if (a == b || a == c || a == d || b == c || b == d || c == d) return 0;
  return 1;
  if (cross(a, b, c) == cross(a, b, d)) return 0;
  if (cross(c, d, a) == cross(c, d, b)) return 0;
  return 1;
}
double dis(pair<int, int> a, pair<int, int> b) {
  a.first -= b.first;
  a.second -= b.second;
  return sqrt(1.0 * a.first * a.first + 1.0 * a.second * a.second);
}
int main() {
  while (scanf("%d%d", &n, &m) != -1) {
    if (n == 0)
      PR(0, 1), PR(0, m), PR(0, 0), PR(0, m - 1);
    else if (m == 0)
      PR(1, 0), PR(n, 0), PR(0, 0), PR(n - 1, 0);
    else {
      vector<pair<int, int> > a;
      a.push_back(make_pair(0, 0));
      a.push_back(make_pair(0, 1));
      a.push_back(make_pair(1, 0));
      a.push_back(make_pair(n, 0));
      a.push_back(make_pair(n - 1, 0));
      a.push_back(make_pair(n, 1));
      a.push_back(make_pair(0, m));
      a.push_back(make_pair(0, m - 1));
      a.push_back(make_pair(1, m));
      a.push_back(make_pair(n, m));
      a.push_back(make_pair(n - 1, m));
      a.push_back(make_pair(n, m - 1));
      pair<int, int> p, q, r, w;
      int i, j, k, t;
      double Max = 0;
      for (i = 0; i < 12; i++)
        for (j = 0; j < 12; j++)
          for (k = 0; k < 12; k++)
            for (t = 0; t < 12; t++) {
              if (ok(a[i], a[j], a[k], a[t])) {
                double tmp =
                    dis(a[i], a[j]) + dis(a[j], a[k]) + dis(a[k], a[t]);
                if (tmp > Max) {
                  Max = tmp;
                  p = a[i];
                  q = a[j];
                  r = a[k];
                  w = a[t];
                }
              }
            }
      PR(p.first, p.second);
      PR(q.first, q.second);
      PR(r.first, r.second);
      PR(w.first, w.second);
    }
  }
}

### Prompt

Develop a solution in CPP to the problem described below:

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;
void RD(int &x) { scanf("%d", &x); }
void RD(unsigned int &x) { scanf("%u", &x); }
void RD(double &x) { scanf("%lf", &x); }
void RD(int &x, int &y) { scanf("%d%d", &x, &y); }
void RD(unsigned int &x, unsigned int &y) { scanf("%u%u", &x, &y); }
void RD(double &x, double &y) { scanf("%lf%lf", &x, &y); }
void RD(int &x, int &y, int &z) { scanf("%d%d%d", &x, &y, &z); }
void RD(unsigned int &x, unsigned int &y, unsigned int &z) {
  scanf("%u%u%u", &x, &y, &z);
}
void RD(double &x, double &y, double &z) { scanf("%lf%lf%lf", &x, &y, &z); }
void RD(char &x) { x = getchar(); }
void RD(char *s) { scanf("%s", s); }
void RD(string &s) { cin >> s; }
void PR(int x) { printf("%d\n", x); }
void PR(int x, int y) { printf("%d %d\n", x, y); }
void PR(unsigned int x) { printf("%u\n", x); }
void PR(unsigned long long x) { cout << x << endl; }
void PR(double x) { printf("%.4lf\n", x); }
void PR(char x) { printf("%c\n", x); }
void PR(char *x) { printf("%s\n", x); }
void PR(string x) { cout << x << endl; }
void PR(long long x) { cout << x << endl; }
void upMin(int &x, int y) {
  if (x > y) x = y;
}
void upMin(long long &x, long long y) {
  if (x > y) x = y;
}
void upMin(double &x, double y) {
  if (x > y) x = y;
}
void upMax(int &x, int y) {
  if (x < y) x = y;
}
void upMax(long long &x, long long y) {
  if (x < y) x = y;
}
void upMax(double &x, double y) {
  if (x < y) x = y;
}
int sgn(double x) {
  if (x > 1e-8) return 1;
  if (x < -1e-8) return -1;
  return 0;
}
long long Gcd(long long x, long long y) {
  if (x < 0) x = -x;
  if (y < 0) y = -y;
  if (y == 0) return x;
  return Gcd(y, x % y);
}
long long Lcm(long long x, long long y) { return x / Gcd(x, y) * y; }
long long eular(long long n) {
  long long ans = n, i;
  for (i = 2; i * i <= n; i++)
    if (n % i == 0) {
      ans -= ans / i;
      while (n % i == 0) n /= i;
    }
  if (n > 1) ans -= ans / n;
  return ans;
}
long long exGcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long temp = exGcd(b, a % b, x, y);
  long long t = x;
  x = y;
  y = t - a / b * y;
  return temp;
}
long long gcdReverse(long long a, long long b) {
  long long x, y;
  long long g = exGcd(a, b, x, y);
  if (g != 1) return 0;
  x %= b;
  if (x < 0) x += b;
  return x;
}
long long myPow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a;
    a = a * a;
    b >>= 1;
  }
  return ans;
}
long long myPow(long long a, long long b, long long mod) {
  a %= mod;
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long getInt() {
  long long x = 0, flag = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') {
    flag = -1, c = getchar();
    while (!isdigit(c)) c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * flag;
}
long long getSqrt(long long t) {
  long long p = sqrt(1.0 * t);
  while (p * p > t) p--;
  while ((p + 1) <= t / (p + 1)) p++;
  return p;
}
struct point {
  double x, y;
  point() {}
  point(double _x, double _y) {
    x = _x;
    y = _y;
  }
  void get() { scanf("%lf%lf", &x, &y); }
  point operator+(point a) { return point(x + a.x, y + a.y); }
  point operator-(point a) { return point(x - a.x, y - a.y); }
  point operator*(double t) { return point(x * t, y * t); }
  double operator*(point a) { return x * a.y - y * a.x; }
  double operator^(point a) { return x * a.x + y * a.y; }
  double Len() { return sqrt(x * x + y * y); }
  point adjustTo(double L) {
    L /= Len();
    return point(x * L, y * L);
  }
  point operator/(double t) { return point(x / t, y / t); }
  double rotateAngle(point a) {
    point p = *this;
    return atan2(p * a, p ^ a);
  }
  int operator==(point a) { return sgn(x - a.x) == 0 && sgn(y - a.y) == 0; }
  point zhuanNi(double ang) {
    return point(x * cos(ang) - y * sin(ang), x * sin(ang) + y * cos(ang));
  }
  point zhuanShun(double ang) {
    return point(x * cos(ang) + y * sin(ang), -x * sin(ang) + y * cos(ang));
  }
  void print() { printf("%.4lf %.4lf\n", x, y); }
};
double calPloyArea(point a[], int n) {
  double ans = 0;
  int i;
  for (i = 0; i < n; i++) ans += a[i] * a[(i + 1) % n];
  return ans;
}
int changeToClockwise(point a[], int n) {
  double s = calPloyArea(a, n);
  if (sgn(s) >= 0) return 0;
  int L = 0, R = n - 1;
  while (L < R) swap(a[L++], a[R--]);
  return 1;
}
int pointOnSeg(point p, point a, point b) {
  if (sgn((p - a) * (p - b))) return 0;
  int x = sgn((p.x - a.x) * (p.x - b.x));
  int y = sgn((p.y - a.y) * (p.y - b.y));
  return x <= 0 && y <= 0;
}
int pointOnRightOfLine(point p, point a, point b) {
  return sgn((p - a) * (b - a)) > 0;
}
int pointOnLine(point p, point a, point b) {
  return sgn((p - a) * (b - a)) == 0;
}
int pointOnLeftOfLine(point p, point a, point b) {
  return sgn((b - a) * (p - a)) > 0;
}
int getRelationOfPointAndPloy(point a[], int n, point p) {
  a[n] = a[0];
  int i;
  double sum = 0;
  for (i = 0; i < n; i++) {
    if (pointOnSeg(p, a[i], a[i + 1])) return 0;
    point aa = a[i] - p;
    point bb = a[i + 1] - p;
    sum += aa.rotateAngle(bb);
  }
  if (fabs(sum - 2 * acos(-1.0)) < 1e-2) return -1;
  return 1;
}
int isParal(point a, point b, point p, point q) {
  double aa = (b.x - a.x) * (p.y - q.y);
  double bb = (b.y - a.y) * (p.x - q.x);
  return sgn(aa - bb) == 0;
}
int lineCrossLine(point a, point b, point p, point q, point &ans) {
  if (isParal(a, b, p, q)) {
    if (!pointOnLine(p, a, b)) return 0;
    return 2;
  }
  double s1 = (p - a) * (q - a);
  double s2 = (q - b) * (p - b);
  ans = (a * s2 + b * s1) / (s1 + s2);
  return 1;
}
int segCrossSeg(point a, point b, point p, point q, point &ans) {
  if (isParal(a, b, p, q)) {
    if (!pointOnLine(p, a, b)) return 0;
    if (sgn(a.x - b.x) == 0) {
      if (p.y > q.y) swap(p, q);
      if (a.y > b.y) swap(a, b);
      if (sgn(q.y - a.y) == -1 || sgn(b.y - p.y) == -1) return 0;
      if (q == a || p == b) {
        if (q == a) ans = q;
        if (p == b) ans = p;
        return 1;
      }
      return 2;
    }
    if (p.x > q.x) swap(p, q);
    if (a.x > b.x) swap(a, b);
    if (sgn(q.x - a.x) == -1 || sgn(b.x - p.x) == -1) return 0;
    if (q == a || p == b) {
      if (q == a) ans = q;
      if (p == b) ans = p;
      return 1;
    }
    return 2;
  }
  lineCrossLine(a, b, p, q, ans);
  if (pointOnSeg(ans, a, b) && pointOnSeg(ans, p, q)) return 1;
  return 0;
}
const long long MM = 1000000000000LL;
struct BigInteger {
  long long a[105];
  int cnt;
  BigInteger() {
    cnt = 1;
    a[1] = 0;
  }
  BigInteger(long long x) {
    if (x == 0) {
      cnt = 1;
      a[1] = 0;
      return;
    }
    cnt = 1;
    a[1] = x;
  }
  BigInteger operator*(int x) {
    BigInteger p = *this;
    int i;
    for (i = 1; i <= p.cnt; i++) p.a[i] *= x;
    int t = 0;
    for (i = 1; i <= p.cnt; i++) {
      p.a[i] += t;
      t = p.a[i] / MM;
      p.a[i] %= MM;
    }
    if (t == 0) return p;
    while (t) p.a[++p.cnt] = t % MM, t /= MM;
    return p;
  }
  int zero() { return cnt == 1 && a[1] == 0; }
  BigInteger operator+(BigInteger a) {
    BigInteger p, q;
    if (a.cnt > cnt)
      p = a, q = *this;
    else
      p = *this, q = a;
    int i;
    for (i = 1; i <= q.cnt; i++) p.a[i] += q.a[i];
    int re = 0;
    for (i = 1; i <= p.cnt; i++) {
      p.a[i] += re;
      re = p.a[i] / MM;
      p.a[i] %= MM;
    }
    if (re) {
      p.a[++p.cnt] = re;
    }
    return p;
  }
};
struct fraction {
  long long a, b;
  fraction() {
    a = 0;
    b = 1;
  }
  fraction(long long x) {
    a = x;
    b = 1;
  }
  fraction(long long x, long long y) {
    a = x;
    b = y;
    deal();
  }
  void deal() {
    if (b < 0) b = -b, a = -a;
    long long k = Gcd(a, b);
    if (k < 0) k = -k;
    a /= k;
    b /= k;
  }
  fraction operator+(fraction p) {
    fraction ans;
    ans.b = Lcm(b, p.b);
    ans.a = ans.b / b * a + ans.b / p.b * p.a;
    ans.deal();
    return ans;
  }
  fraction operator-(fraction p) {
    fraction ans;
    ans.b = Lcm(b, p.b);
    ans.a = ans.b / b * a - ans.b / p.b * p.a;
    ans.deal();
    return ans;
  }
  fraction operator*(fraction p) {
    fraction ans;
    ans.a = a * p.a;
    ans.b = b * p.b;
    ans.deal();
    return ans;
  }
  fraction operator/(fraction p) {
    fraction ans;
    ans.a = a * p.b;
    ans.b = b * p.a;
    ans.deal();
    return ans;
  }
  int operator==(fraction p) { return a * p.b == b * p.a; }
  int operator!=(fraction p) {
    if ((*this) == p) return 0;
    return 1;
  }
  int isZero() { return a == 0; }
};
const int matrixSize = 3;
int matrixMod;
struct Matrix {
  long long a[3][3];
  void init(int t = 0) {
    int i, j;
    for (i = 0; i < matrixSize; i++)
      for (j = 0; j < matrixSize; j++) a[i][j] = 0;
    if (t) {
      for (i = 0; i < matrixSize; i++) a[i][i] = 1;
    }
  }
  Matrix operator*(Matrix p) {
    Matrix ans;
    ans.init();
    int i, j, k;
    int x = matrixSize;
    for (k = 0; k < x; k++)
      for (i = 0; i < x; i++)
        for (j = 0; j < x; j++) {
          ans.a[i][j] += a[i][k] * p.a[k][j] % matrixMod;
          ans.a[i][j] %= matrixMod;
        }
    return ans;
  }
  Matrix pow(long long t) {
    Matrix p = *this, ans;
    ans.init(1);
    while (t) {
      if (t & 1) ans = ans * p;
      p = p * p;
      t >>= 1;
    }
    return ans;
  }
  void print() {
    int i, j;
    for (i = 0; i < matrixSize; i++) {
      for (j = 0; j < matrixSize; j++) cout << a[i][j] << ' ';
      puts("");
    }
  }
};
const int mod = 1000000007;
const long long inf = (((long long)1) << 61) + 5;
const double dinf = 1000000000;
const int INF = 2000000005;
const int N = 1111111;
int n, m;
int cross(pair<int, int> a, pair<int, int> b, pair<int, int> p) {
  b.first -= a.first;
  b.second -= a.second;
  p.first -= a.first;
  p.second -= a.second;
  int x = b.first * p.second - b.second * p.first;
  if (x < 0) return -1;
  if (x > 0) return 1;
  return 0;
}
int ok(pair<int, int> a, pair<int, int> b, pair<int, int> c, pair<int, int> d) {
  if (a == b || a == c || a == d || b == c || b == d || c == d) return 0;
  return 1;
  if (cross(a, b, c) == cross(a, b, d)) return 0;
  if (cross(c, d, a) == cross(c, d, b)) return 0;
  return 1;
}
double dis(pair<int, int> a, pair<int, int> b) {
  a.first -= b.first;
  a.second -= b.second;
  return sqrt(1.0 * a.first * a.first + 1.0 * a.second * a.second);
}
int main() {
  while (scanf("%d%d", &n, &m) != -1) {
    if (n == 0)
      PR(0, 1), PR(0, m), PR(0, 0), PR(0, m - 1);
    else if (m == 0)
      PR(1, 0), PR(n, 0), PR(0, 0), PR(n - 1, 0);
    else {
      vector<pair<int, int> > a;
      a.push_back(make_pair(0, 0));
      a.push_back(make_pair(0, 1));
      a.push_back(make_pair(1, 0));
      a.push_back(make_pair(n, 0));
      a.push_back(make_pair(n - 1, 0));
      a.push_back(make_pair(n, 1));
      a.push_back(make_pair(0, m));
      a.push_back(make_pair(0, m - 1));
      a.push_back(make_pair(1, m));
      a.push_back(make_pair(n, m));
      a.push_back(make_pair(n - 1, m));
      a.push_back(make_pair(n, m - 1));
      pair<int, int> p, q, r, w;
      int i, j, k, t;
      double Max = 0;
      for (i = 0; i < 12; i++)
        for (j = 0; j < 12; j++)
          for (k = 0; k < 12; k++)
            for (t = 0; t < 12; t++) {
              if (ok(a[i], a[j], a[k], a[t])) {
                double tmp =
                    dis(a[i], a[j]) + dis(a[j], a[k]) + dis(a[k], a[t]);
                if (tmp > Max) {
                  Max = tmp;
                  p = a[i];
                  q = a[j];
                  r = a[k];
                  w = a[t];
                }
              }
            }
      PR(p.first, p.second);
      PR(q.first, q.second);
      PR(r.first, r.second);
      PR(w.first, w.second);
    }
  }
}

```