#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000 + 10;
struct node {
  int x, y;
  node() {}
  node(int _x, int _y) : x(_x), y(_y) {}
};
node p[maxN << 1], q[maxN << 1];
int np, nq;
double dist(node s, node t) { return 1e10 * hypot(s.x - t.x, s.y - t.y); }
int main() {
  int n, m;
  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;
  }
  if (m == 0) {
    cout << 1 << " " << 0 << endl;
    cout << n << " " << 0 << endl;
    cout << 0 << " " << 0 << endl;
    cout << (n - 1) << " " << 0 << endl;
    return 0;
  }
  np = 0;
  for (int x = 1; x <= n; x++) {
    if (!(x <= 10 || x + 10 >= n)) continue;
    p[np].x = x;
    p[np].y = 0;
    np++;
  }
  for (int y = 1; y < m; y++) {
    if (!(y <= 10 || y + 10 >= m)) continue;
    p[np].x = n;
    p[np].y = y;
    np++;
  }
  nq = 0;
  for (int x = n - 1; x >= 0; x--) {
    if (!(x <= 10 || x + 10 >= n)) continue;
    q[nq].x = x;
    q[nq].y = m;
    nq++;
  }
  for (int y = m - 1; y > 0; y--) {
    if (!(y <= 10 || y + 10 >= m)) continue;
    q[nq].x = 0;
    q[nq].y = y;
    nq++;
  }
  node a = node(0, 0);
  node b = node(n, m);
  node c, d, p1, p2, p3, p4;
  double res = -1.0, tmp;
  int i, j;
  double based = dist(a, b);
  for (i = 0; i < np; i++) {
    for (j = 0; j < nq; j++) {
      c = p[i], d = q[j];
      tmp = based + dist(a, c) + dist(c, d);
      if (tmp > res) {
        res = tmp;
        p1 = b;
        p2 = a;
        p3 = c;
        p4 = d;
      }
      tmp = based + dist(b, c) + dist(c, d);
      if (tmp > res) {
        res = tmp;
        p1 = a;
        p2 = b;
        p3 = c;
        p4 = d;
      }
      tmp = based + dist(a, d) + dist(d, c);
      if (tmp > res) {
        res = tmp;
        p1 = b;
        p2 = a;
        p3 = d;
        p4 = c;
      }
      tmp = based + dist(b, d) + dist(d, c);
      if (tmp > res) {
        res = tmp;
        p1 = a;
        p2 = b;
        p3 = d;
        p4 = c;
      }
      tmp = based + dist(a, c) + dist(b, d);
      if (tmp > res) {
        res = tmp;
        p1 = c;
        p2 = a;
        p3 = b;
        p4 = d;
      }
      tmp = based + dist(c, b) + dist(a, d);
      if (tmp > res) {
        res = tmp;
        p1 = c;
        p2 = b;
        p3 = a;
        p4 = d;
      }
    }
  }
  cout << p1.x << " " << p1.y << endl;
  cout << p2.x << " " << p2.y << endl;
  cout << p3.x << " " << p3.y << endl;
  cout << p4.x << " " << p4.y << endl;
  return 0;
}
