#include <bits/stdc++.h>
using namespace std;
int n, m;
double dist(pair<int, int> a, pair<int, int> b) {
  return sqrt(pow(a.first - b.first, 2) + pow(a.second - b.second, 2));
}
int main() {
  while (cin >> n >> m) {
    set<pair<int, int> > pts;
    do {
      if (0 <= 0 && 0 <= n && 0 <= 0 && 0 <= m) pts.insert(make_pair(0, 0));
    } while (0);
    do {
      if (0 <= 0 && 0 <= n && 0 <= 1 && 1 <= m) pts.insert(make_pair(0, 1));
    } while (0);
    do {
      if (0 <= 1 && 1 <= n && 0 <= 0 && 0 <= m) pts.insert(make_pair(1, 0));
    } while (0);
    do {
      if (0 <= 1 && 1 <= n && 0 <= 1 && 1 <= m) pts.insert(make_pair(1, 1));
    } while (0);
    do {
      if (0 <= n && n <= n && 0 <= m && m <= m) pts.insert(make_pair(n, m));
    } while (0);
    do {
      if (0 <= n && n <= n && 0 <= m - 1 && m - 1 <= m)
        pts.insert(make_pair(n, m - 1));
    } while (0);
    do {
      if (0 <= n - 1 && n - 1 <= n && 0 <= m && m <= m)
        pts.insert(make_pair(n - 1, m));
    } while (0);
    do {
      if (0 <= n - 1 && n - 1 <= n && 0 <= m - 1 && m - 1 <= m)
        pts.insert(make_pair(n - 1, m - 1));
    } while (0);
    do {
      if (0 <= 0 && 0 <= n && 0 <= m && m <= m) pts.insert(make_pair(0, m));
    } while (0);
    do {
      if (0 <= 0 && 0 <= n && 0 <= m - 1 && m - 1 <= m)
        pts.insert(make_pair(0, m - 1));
    } while (0);
    do {
      if (0 <= 1 && 1 <= n && 0 <= m && m <= m) pts.insert(make_pair(1, m));
    } while (0);
    do {
      if (0 <= 1 && 1 <= n && 0 <= m - 1 && m - 1 <= m)
        pts.insert(make_pair(1, m - 1));
    } while (0);
    do {
      if (0 <= n && n <= n && 0 <= 0 && 0 <= m) pts.insert(make_pair(n, 0));
    } while (0);
    do {
      if (0 <= n && n <= n && 0 <= 1 && 1 <= m) pts.insert(make_pair(n, 1));
    } while (0);
    do {
      if (0 <= n - 1 && n - 1 <= n && 0 <= 0 && 0 <= m)
        pts.insert(make_pair(n - 1, 0));
    } while (0);
    do {
      if (0 <= n - 1 && n - 1 <= n && 0 <= 1 && 1 <= m)
        pts.insert(make_pair(n - 1, 1));
    } while (0);
    vector<pair<int, int> > v(pts.begin(), pts.end());
    vector<pair<int, int> > ans(4);
    double mx = 0;
    int len = v.size();
    for (int i1 = 0; i1 < len; i1++)
      for (int i2 = i1 + 1; i2 < len; i2++)
        for (int i3 = i2 + 1; i3 < len; i3++)
          for (int i4 = i3 + 1; i4 < len; i4++) {
            int p[] = {i1, i2, i3, i4};
            do {
              double x = 0;
              for (int i = 0; i < 3; i++) {
                x += dist(v[p[i]], v[p[i + 1]]);
              }
              if (x > mx) {
                mx = x;
                for (int i = 0; i < 4; i++) ans[i] = v[p[i]];
              }
            } while (next_permutation(p, p + 4));
          }
    for (int i = 0; i < 4; i++) {
      cout << ans[i].first << " " << ans[i].second << "\n";
    }
  }
  return 0;
}
