#include <bits/stdc++.h>
using namespace std;
long double best = -1;
vector<pair<int, int> > ans;
int n, m;
long double dist(pair<int, int> a, pair<int, int> b) {
  return hypot((long double)a.first - b.first,
               (long double)a.second - b.second);
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> m >> n;
  set<pair<int, int> > pts, rem;
  pts.insert(make_pair(0, 0));
  pts.insert(make_pair(m, n));
  pts.insert(make_pair(0, n));
  pts.insert(make_pair(m, 0));
  pts.insert(make_pair(1, 0));
  pts.insert(make_pair(0, 1));
  pts.insert(make_pair(m - 1, n));
  pts.insert(make_pair(m, n - 1));
  pts.insert(make_pair(1, n));
  pts.insert(make_pair(0, n - 1));
  pts.insert(make_pair(m - 1, 0));
  pts.insert(make_pair(m, 1));
  for (auto p : pts) {
    if (p.first < 0 || p.first > m || p.second < 0 || p.second > n)
      rem.insert(p);
  }
  for (auto p : rem) pts.erase(p);
  vector<pair<int, int> > points(pts.begin(), pts.end());
  int a = points.size();
  for (int i = 0, _i = (a); i < _i; ++i) {
    for (int j = 0, _j = (a); j < _j; ++j) {
      if (j == i) continue;
      for (int k = 0, _k = (a); k < _k; ++k) {
        if (k == i || k == j) continue;
        for (int l = 0, _l = (a); l < _l; ++l) {
          if (l == k || l == i || l == j) continue;
          long double cur = dist(points[i], points[j]) +
                            dist(points[j], points[k]) +
                            dist(points[k], points[l]);
          if (cur > best) {
            best = cur;
            ans.clear();
            ans.push_back(points[i]);
            ans.push_back(points[j]);
            ans.push_back(points[k]);
            ans.push_back(points[l]);
          }
        }
      }
    }
  }
  for (int i = 0, _i = (4); i < _i; ++i) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
}
