#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int n, m;
long long dist(int x, int y, int xx, int yy) {
  return ((x - xx) * 1ll * (x - xx) + (y - yy) * 1ll * (y - yy));
}
bool ok(int x, int y) { return (x >= 0 && x <= n && y >= 0 && y <= m); }
int main() {
  scanf("%d %d", &n, &m);
  vector<pair<int, int>> v;
  for (int i = 0; i < 12; ++i) {
    if (ok(i, 0)) v.push_back({i, 0});
    if (ok(0, i)) v.push_back({0, i});
  }
  for (int i = 0; i < 12; ++i) {
    if (ok(n - i, 0)) v.push_back({n - i, 0});
    if (ok(n, i)) v.push_back({n, i});
  }
  for (int i = 0; i < 12; ++i) {
    if (ok(0, m - i)) v.push_back({0, m - i});
    if (ok(i, m)) v.push_back({i, m});
  }
  for (int i = 0; i < 12; ++i) {
    if (ok(n, m - i)) v.push_back({n, m - i});
    if (ok(n - i, m)) v.push_back({n - i, m});
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  int mm = v.size();
  long long res = 0;
  pair<pair<int, int>, pair<int, int>> ans = {{-1, -1}, {-1, -1}};
  for (int i = 0; i < mm; ++i)
    for (int j = 0; j < mm; ++j)
      for (int k = 0; k < mm; ++k)
        for (int l = 0; l < mm; ++l) {
          if (i == j || i == k || i == l || j == k || j == l || k == l)
            continue;
          long long d1 = dist(v[i].first, v[i].second, v[j].first, v[j].second);
          long long d2 = dist(v[j].first, v[j].second, v[k].first, v[k].second);
          long long d3 = dist(v[k].first, v[k].second, v[l].first, v[l].second);
          if (d1 + d2 + d3 > res) {
            res = d1 + d2 + d3;
            assert(i != k);
            ans = {{i, j}, {k, l}};
          }
        }
  printf("%d %d\n", v[ans.first.first].first, v[ans.first.first].second);
  printf("%d %d\n", v[ans.first.second].first, v[ans.first.second].second);
  printf("%d %d\n", v[ans.second.first].first, v[ans.second.first].second);
  printf("%d %d\n", v[ans.second.second].first, v[ans.second.second].second);
}
