#include <bits/stdc++.h>
const int MAX = 11;
using namespace std;
struct Point {
  int _x, _y;
  Point(int x, int y) : _x(x), _y(y) {}
  double distance(const Point &a) const {
    return sqrt((_x - a._x) * (_x - a._x) + (_y - a._y) * (_y - a._y));
  }
  bool operator==(const Point &rht) const {
    return _x == rht._x && _y == rht._y;
  }
  bool operator!=(const Point &rht) const { return !(this->operator==(rht)); }
  bool operator<(const Point &rht) const {
    return this->distance(Point(0, 0)) <= rht.distance(Point(0, 0));
  }
};
static int dx[] = {+0, +0, +1, -1, +1, +1, -1, -1, +0};
static int dy[] = {+1, -1, +0, +0, +1, -1, -1, +1, +0};
static int n, m;
static int ok(int x, int y) { return 0 <= x && x <= n && 0 <= y && y <= m; }
static void add(set<Point> &all, int x, int y) {
  int t = sizeof(dx) / sizeof(dx[0]);
  for (int i = 0; i < (t); ++i) {
    int nx = x + dx[i];
    int ny = y + dy[i];
    if (ok(nx, ny)) {
      all.insert(Point(nx, ny));
    }
  }
}
int main() {
  scanf("%d%d", &(n), &(m));
  set<Point> all;
  add(all, 0, 0);
  add(all, n, m);
  add(all, 0, m);
  add(all, n, 0);
  vector<Point> laa(all.begin(), all.end()), res;
  double mx = 0;
  for (int i = 0; i < (int((laa).size())); ++i) {
    for (int j = 0; j < (int((laa).size())); ++j) {
      for (int k = 0; k < (int((laa).size())); ++k) {
        for (int t = 0; t < (int((laa).size())); ++t) {
          if (laa[i] == laa[j] || laa[i] == laa[k] || laa[i] == laa[t])
            continue;
          if (laa[j] == laa[k] || laa[j] == laa[t]) continue;
          if (laa[t] == laa[k]) continue;
          double d = laa[i].distance(laa[j]) + laa[j].distance(laa[k]) +
                     laa[k].distance(laa[t]);
          if (mx < d) {
            mx = d;
            res = {laa[i], laa[j], laa[k], laa[t]};
          }
        }
      }
    }
  }
  for (int i = 0; i < (int((res).size())); ++i) {
    printf("%d %d\n", res[i]._x, res[i]._y);
  }
  return 0;
}
