#include <bits/stdc++.h>
using namespace std;
struct point {
  int x, y;
  point(int x = 0, int y = 0) : x(x), y(y) {}
};
double dist(point a, point b) {
  return sqrt((a.x - b.x) * 1.0 * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
int n, m;
vector<point> p;
set<pair<int, int> > used;
double calclen(point a, point b, point c, point d) {
  return dist(a, b) + dist(b, c) + dist(c, d);
}
void gen(int x0, int y0) {
  for (int x = x0 - 3; x <= x0 + 3; x++) {
    for (int y = y0 - 3; y <= y0 + 3; y++) {
      if (x >= 0 && x <= n && y >= 0 && y <= m &&
          used.count(make_pair(x, y)) == 0) {
        p.push_back(point(x, y));
        used.insert((make_pair(x, y)));
      }
    }
  }
}
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    gen(0, 0);
    gen(n, 0);
    gen(0, m);
    gen(n, m);
    vector<point> best;
    double ans = 0;
    for (int i = 0; i < p.size(); i++) {
      for (int j = 0; j < p.size(); j++) {
        if (i == j) continue;
        for (int k = 0; k < p.size(); k++) {
          if (k == i || k == j) continue;
          for (int t = 0; t < p.size(); t++) {
            if (t == k || t == i || t == j) continue;
            double len = calclen(p[i], p[j], p[k], p[t]);
            if (len > ans) {
              ans = len;
              vector<point> cur(4);
              cur[0] = p[i];
              cur[1] = p[j];
              cur[2] = p[k];
              cur[3] = p[t];
              best = cur;
            }
          }
        }
      }
    }
    for (int i = 0; i < 4; i++) {
      printf("%d %d\n", best[i].x, best[i].y);
    }
  }
  return 0;
}
