#include <bits/stdc++.h>
using namespace std;
int h, w, n;
vector<int> x;
vector<int> y;
void check(int i, int j) {
  if (0 <= i && 0 <= j)
    if (i <= h && j <= w) {
      x.push_back(i);
      y.push_back(j);
    }
}
double best = -1;
vector<int> ans;
double cost[100][100];
void go(int i, vector<int>& cur, vector<bool>& seen) {
  if (i == 4) {
    double dist = 0;
    for (int i = 0; i <= 2; ++i) dist += cost[cur[i]][cur[i + 1]];
    if (dist > best) {
      ans = cur;
      best = dist;
    }
    return;
  }
  for (int j = 0; j < n; ++j)
    if (!seen[j]) {
      bool ok = true;
      for (int k = 0; k < i; ++k)
        if (x[cur[k]] == x[j] && y[cur[k]] == y[j]) ok = false;
      if (!ok) continue;
      seen[j] = true;
      cur[i] = j;
      go(i + 1, cur, seen);
      seen[j] = false;
    }
}
int main() {
  cin >> h >> w;
  for (int dx = -1; dx <= 1; ++dx)
    for (int dy = -1; dy <= 1; ++dy) {
      check(dx, dy);
      check(h + dx, dy);
      check(dx, w + dy);
      check(h + dx, w + dy);
    }
  n = x.size();
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j)
      cost[i][j] = hypot(double(x[i] - x[j]), double(y[i] - y[j]));
  vector<bool> seen(n, false);
  vector<int> cur(n, true);
  go(0, cur, seen);
  for (int i = 0; i < 4; ++i) cout << x[ans[i]] << ' ' << y[ans[i]] << endl;
  return 0;
}
