#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
const int maxn = 18;
const int maxm = 110;
const int maxmask = (1 << maxn) - 1;
const int infi = 1e9 + 7;
const long long infl = 1e18;
const double eps = 1e-6;
const int mod = 1e9 + 7;
vector<pair<int, int> > ar;
pair<int, int> ans[4];
int sqr(int a) { return a * a; }
double dist(pair<int, int> a, pair<int, int> b) {
  return sqrt((double)sqr(a.first - b.first) + sqr(a.second - b.second));
}
vector<pair<int, int> > arz, arx;
int main() {
  int n, m;
  cin >> n >> m;
  arz.push_back(make_pair(0, 0)), arz.push_back(make_pair(0, 1)),
      arz.push_back(make_pair(1, 0)), arz.push_back(make_pair(1, 1));
  arz.push_back(make_pair(n, m)), arz.push_back(make_pair(n - 1, m)),
      arz.push_back(make_pair(n, m - 1)),
      arz.push_back(make_pair(n - 1, m - 1));
  arz.push_back(make_pair(0, m)), arz.push_back(make_pair(1, m)),
      arz.push_back(make_pair(0, m - 1)), arz.push_back(make_pair(1, m - 1));
  arz.push_back(make_pair(n, 0)), arz.push_back(make_pair(n, 1)),
      arz.push_back(make_pair(n - 1, 0)), arz.push_back(make_pair(n - 1, 1));
  sort(arz.begin(), arz.end());
  for (int i = 0; i < arz.size() - 1; ++i) {
    if (arz[i] != arz[i + 1] && arz[i].first >= 0 && arz[i].first <= n &&
        arz[i].second >= 0 && arz[i].second <= m) {
      arx.push_back(arz[i]);
    }
  }
  int i = arz.size() - 1;
  if (arz[i].first >= 0 && arz[i].first <= n && arz[i].second >= 0 &&
      arz[i].second <= m) {
    arx.push_back(arz[i]);
  }
  double res = 0;
  int k = arx.size();
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < k; ++j) {
      if (i == j) {
        continue;
      }
      double a = dist(arx[i], arx[j]);
      int z, x;
      z = x = -1;
      for (int q = 0; q < arx.size(); ++q) {
        if (arx[q] == arx[i] || arx[q] == arx[j]) {
          continue;
        }
        if (z == -1 || dist(arx[z], arx[i]) < dist(arx[q], arx[i])) {
          z = q;
        }
      }
      for (int q = 0; q < arx.size(); ++q) {
        if (arx[q] == arx[i] || arx[q] == arx[j]) {
          continue;
        }
        if (x == -1 || dist(arx[x], arx[j]) < dist(arx[q], arx[j])) {
          x = q;
        }
      }
      if (x == z) {
        z = -1;
        for (int q = 0; q < arx.size(); ++q) {
          if (arx[q] == arx[i] || arx[q] == arx[j]) {
            continue;
          }
          if (q != x &&
              (z == -1 || dist(arx[z], arx[i]) < dist(arx[q], arx[i]))) {
            z = q;
          }
        }
        double b = dist(arx[z], arx[i]) + dist(arx[x], arx[j]);
        int s = z;
        z = x;
        x = -1;
        for (int q = 0; q < arx.size(); ++q) {
          if (arx[q] == arx[i] || arx[q] == arx[j]) {
            continue;
          }
          if (q != z &&
              (x == -1 || dist(arx[x], arx[j]) < dist(arx[q], arx[j]))) {
            x = q;
          }
        }
        double c = dist(arx[z], arx[i]) + dist(arx[x], arx[j]);
        int d = x;
        x = z;
        if (c > b) {
          x = d;
        } else {
          z = s;
        }
      }
      a += dist(arx[z], arx[i]) + dist(arx[x], arx[j]);
      if (a > res) {
        res = a;
        ans[0] = arx[z], ans[1] = arx[i], ans[2] = arx[j], ans[3] = arx[x];
      }
    }
  }
  for (int i = 0; i < 4; ++i) {
    cout << ans[i].first << ' ' << ans[i].second << endl;
  }
  return 0;
}
