#include <bits/stdc++.h>
using namespace std;
const int Mod = 998244353;
int dcmp(double x) {
  if (fabs(x) <= 1e-7) return 0;
  return x < 0 ? -1 : 1;
}
struct Point {
  long long x, y;
  Point() {}
  Point(long long x, long long y) : x(x), y(y) {}
  Point operator-(const Point &a) const { return Point(x - a.x, y - a.y); }
  Point operator+(const Point &a) const { return Point(x + a.x, y + a.y); }
  Point operator*(const double &a) const { return Point(x * a, y * a); }
  bool operator<(const Point &a) const {
    if (x == a.x) return y < a.y;
    return x < a.x;
  }
  bool operator==(const Point &a) const { return x == a.x && y == a.y; }
};
struct cycle {
  Point p;
  long long r;
  cycle() {}
  cycle(Point p, long long r) : p(p), r(r) {}
};
struct Line {
  Point p;
  Point v;
  double ang;
  Line() {}
  Line(Point p, Point v) : p(p), v(v) { ang = atan2(v.y, v.x); }
  bool operator<(const Line &l) const { return ang < l.ang; }
};
long long Cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
double Dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
long long dis(Point a) { return Dot(a, a); }
double dist(Point p, Point a, Point b) {
  Point v1 = b - a, v2 = p - a, v3 = p - b;
  if (Dot(v1, v2) < 0) return dis(v2);
  if (Dot(v1, v3) > 0) return dis(v3);
  return fabs(Cross(a - p, b - p)) / dis(a - b);
}
bool chk(Point p, double r, Point q, double rr, double RR) {
  double diss = dis(p - q);
  if (dcmp(RR + r - diss) <= 0) return 1;
  if (dcmp(rr - r - diss) >= 0) return 1;
  if (dcmp(r - RR - diss) >= 0) return 1;
  return 0;
}
vector<Point> vp;
int n, m;
void solve() {
  cin >> n >> m;
  vp.push_back(Point(0, 0));
  vp.push_back(Point(n, m));
  vp.push_back(Point(max(0, n - 1), m));
  vp.push_back(Point(max(0, n - 1), 0));
  vp.push_back(Point(n, max(m - 1, 0)));
  vp.push_back(Point(0, max(m - 1, 0)));
  vp.push_back(Point(0, m));
  vp.push_back(Point(n, 0));
  vp.push_back(Point(min(1, n), 0));
  vp.push_back(Point(min(1, n), m));
  vp.push_back(Point(0, min(1, m)));
  vp.push_back(Point(n, min(1, m)));
  sort(vp.begin(), vp.end());
  int cnt = unique(vp.begin(), vp.end()) - vp.begin();
  long long ans = 0;
  int x1, x2, x3, x4;
  for (int i = 0; i <= cnt - 1; i++) {
    for (int j = 0; j <= cnt - 1; j++) {
      for (int k = 0; k <= cnt - 1; k++) {
        for (int l = 0; l <= cnt - 1; l++) {
          if (i == j || i == k || i == l || j == k || j == l || k == l)
            continue;
          long long crt =
              dis(vp[i] - vp[j]) + dis(vp[j] - vp[k]) + dis(vp[k] - vp[l]);
          if (crt > ans) {
            ans = crt;
            x1 = i;
            x2 = j;
            x3 = k;
            x4 = l;
          }
        }
      }
    }
  }
  cout << vp[x1].x << " " << vp[x1].y << endl;
  cout << vp[x2].x << " " << vp[x2].y << endl;
  cout << vp[x3].x << " " << vp[x3].y << endl;
  cout << vp[x4].x << " " << vp[x4].y << endl;
}
int main() {
  solve();
  return 0;
}
