#include <bits/stdc++.h>
const int INF = 1e9;
using namespace std;
void printAns(bool isSwap, vector<pair<int, int> >& ans) {
  for (int i = 0; i < ans.size(); i++) {
    int x = ans[i].first;
    int y = ans[i].second;
    if (isSwap) {
      swap(x, y);
    }
    cout << x << " " << y << endl;
  }
}
int main() {
  int n, m;
  while (cin >> n >> m) {
    bool isSwap = n < m;
    if (isSwap) {
      swap(n, m);
    }
    if (false && m == 0) {
      vector<pair<int, int> > ans;
      ans.push_back(make_pair(1, 0));
      ans.push_back(make_pair(n, 0));
      ans.push_back(make_pair(0, 0));
      ans.push_back(make_pair(n - 1, 0));
      printAns(isSwap, ans);
      continue;
    }
    double best = 0;
    vector<pair<int, int> > bestAns;
    bestAns.push_back(make_pair(0, 0));
    bestAns.push_back(make_pair(0, 0));
    bestAns.push_back(make_pair(n, m));
    bestAns.push_back(make_pair(n, m));
    for (int i = 1; i < 2 * n + 2 * m; i++) {
      if (i == n + m) {
        continue;
      }
      int x1, y1;
      if (i < n + m) {
        x1 = max(0, i - m);
        y1 = min(i, m);
      } else {
        x1 = min(i - n - m, n);
        y1 = max(0, i - n - n - m);
      }
      double s1 = sqrt(1. * (n - x1) * (n - x1) + 1. * (m - y1) * (m - y1));
      for (int j = 1; j < 2 * n + 2 * m; j++) {
        if (j == n + m) {
          continue;
        }
        int x2, y2;
        if (j < n + m) {
          x2 = max(0, j - m);
          y2 = min(j, m);
        } else {
          x2 = min(j - n - m, n);
          y2 = max(0, j - n - n - m);
        }
        if (x2 == x1 && y2 == y1) {
          continue;
        }
        double s2 =
            sqrt(1. * (x2 - x1) * (x2 - x1) + 1. * (y2 - y1) * (y2 - y1));
        if (s1 + s2 > best) {
          best = s1 + s2;
          bestAns[0] = make_pair(0, 0);
          bestAns[1] = make_pair(n, m);
          bestAns[2] = make_pair(x1, y1);
          bestAns[3] = make_pair(x2, y2);
        }
        double s3 = sqrt(1. * (x2) * (x2) + 1. * (y2) * (y2));
        if (s1 + s3 > best) {
          best = s1 + s3;
          bestAns[0] = make_pair(x2, y2);
          bestAns[1] = make_pair(0, 0);
          bestAns[2] = make_pair(n, m);
          bestAns[3] = make_pair(x1, y1);
        }
      }
    }
    printAns(isSwap, bestAns);
  }
  return 0;
}
