#include <bits/stdc++.h>
using namespace std;
bool solve() {
  int n, m;
  if (scanf("%d%d", &n, &m) == EOF) return false;
  bool flip = false;
  if (n > m) {
    swap(n, m);
    flip = true;
  }
  pair<int, int> ans[4];
  if (n == 0) {
    ans[0] = make_pair(0, 1);
    ans[1] = make_pair(0, m);
    ans[2] = make_pair(0, 0);
    ans[3] = make_pair(0, m - 1);
  } else {
    ans[0] = make_pair(1, 0);
    ans[1] = make_pair(n, m);
    ans[2] = make_pair(0, 0);
    ans[3] = make_pair(n - 1, m);
    double len =
        sqrt(1.0 * n * n + m * m) + 2.0 * sqrt(1.0 * (n - 1) * (n - 1) + m * m);
    for (int i = 1; i <= n; ++i) {
      double tmp = sqrt(1.0 * n * n + m * m) + sqrt(1.0 * i * i + m * m) +
                   sqrt(1.0 * (n - i) * (n - i) + m * m);
      if (tmp > len) {
        len = tmp;
        ans[0] = make_pair(0, 0);
        ans[1] = make_pair(n, m);
        ans[2] = make_pair(i, 0);
        ans[3] = make_pair(0, m);
      }
    }
  }
  if (flip) {
    for (int i = 0; i < 4; ++i) swap(ans[i].first, ans[i].second);
  }
  for (int i = 0; i < 4; ++i) printf("%d %d\n", ans[i].first, ans[i].second);
  return true;
}
int main() {
  while (solve())
    ;
  return 0;
}
