#include <bits/stdc++.h>
using namespace std;
void out(int a, int b) { cout << a << " " << b << endl; }
int xx[9];
int yy[9];
int len;
int n, m;
void add(int x1, int y1) {
  if (x1 < 0 || y1 < 0) return;
  if (x1 > n || y1 > m) return;
  for (int i = 0; i < len; i++) {
    if (xx[i] == x1 && yy[i] == y1) {
      return;
    }
  }
  xx[len] = x1;
  yy[len] = y1;
  len++;
}
int idx[10];
double get_len(int i, int j) {
  double ll =
      (xx[i] - xx[j]) * (xx[i] - xx[j]) + (yy[i] - yy[j]) * (yy[i] - yy[j]);
  ll = sqrt(ll);
  return ll;
}
int main() {
  cin >> n >> m;
  len = 0;
  add(0, 0);
  add(0, 1);
  add(0, m - 1);
  add(0, m);
  add(1, 0);
  add(1, m);
  add(n - 1, 0);
  add(n, 0);
  add(n, 1);
  add(n, m);
  for (int i = 0; i < len; i++) {
    idx[i] = i;
  }
  double ll = 0;
  int ans[4];
  double ans_value = 0;
  do {
    ll = 0;
    ll += get_len(idx[0], idx[1]);
    ll += get_len(idx[1], idx[2]);
    ll += get_len(idx[2], idx[3]);
    if (ll > ans_value) {
      ans_value = ll;
      for (int p = 0; p <= 3; p++) {
        ans[p] = idx[p];
      }
    }
  } while (next_permutation(idx, idx + len));
  out(xx[ans[0]], yy[ans[0]]);
  out(xx[ans[1]], yy[ans[1]]);
  out(xx[ans[2]], yy[ans[2]]);
  out(xx[ans[3]], yy[ans[3]]);
  return 0;
}
