#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
struct point {
  int x, y;
  point() {}
  point(int a, int b) {
    x = a;
    y = b;
  }
  friend bool operator<(point a, point b) {
    if (a.x != b.x) return a.x < b.x;
    return a.y < b.y;
  }
  friend bool operator==(point a, point b) {
    return (a.x == b.x) && a.y == b.y;
  }
};
double dist(point a, point b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
int n, m;
vector<point> v;
int main() {
  scanf("%d %d", &n, &m);
  if (n == 1 && m == 1) {
    printf("1 1\n0 0\n1 0\n0 1\n");
    return 0;
  }
  v.push_back(point(0, 0));
  v.push_back(point(1, 0));
  v.push_back(point(0, 1));
  v.push_back(point(n, m));
  v.push_back(point(n - 1, m));
  v.push_back(point(n, m - 1));
  v.push_back(point(0, m));
  v.push_back(point(n, 0));
  for (int i = (0); i < int(5); ++i)
    for (int j = (0); j < int(5); ++j) v.push_back(point(n - i, m - j));
  for (int i = 0; i < (int)v.size(); i++)
    if (v[i].x > n || v[i].y > m || v[i].x < 0 || v[i].y < 0) {
      v.erase(v.begin() + i);
      i--;
    }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  int N = (int)v.size();
  double sol = -1;
  vector<int> best;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      for (int k = 0; k < N; k++) {
        for (int t = 0; t < N; t++) {
          if (sol + eps <
              dist(v[i], v[j]) + dist(v[j], v[k]) + dist(v[k], v[t])) {
            if (i == j || i == k || i == t || j == k || j == t || k == t)
              continue;
            sol = dist(v[i], v[j]) + dist(v[j], v[k]) + dist(v[k], v[t]);
            best.clear();
            best.push_back(i);
            best.push_back(j);
            best.push_back(k);
            best.push_back(t);
          }
        }
      }
    }
  }
  for (int i = 0; i < 4; i++) printf("%d %d\n", v[best[i]].x, v[best[i]].y);
  return 0;
}
