#include <bits/stdc++.h>
using namespace std;
set<int> px, py;
int pp[110][2], top;
int used[110];
int cur[4];
int ans[4];
double bans;
double dis(int a, int b) {
  return sqrt(((double)((pp[a][0] - pp[b][0]) * (pp[a][0] - pp[b][0]) +
                        (pp[a][1] - pp[b][1]) * (pp[a][1] - pp[b][1]))));
}
void go(int id) {
  if (id == 4) {
    double cans =
        dis(cur[0], cur[1]) + dis(cur[1], cur[2]) + dis(cur[2], cur[3]);
    if (cans > bans) {
      bans = cans;
      for (int i = 0; i < 4; i++) ans[i] = cur[i];
    }
  } else {
    for (int i = 0; i < top; i++)
      if (used[i] == 0) {
        used[i] = 1;
        cur[id] = i;
        go(id + 1);
        used[i] = 0;
      }
  }
}
int main(void) {
  for (;;) {
    int mx, my;
    cin >> mx >> my;
    if (cin.eof()) break;
    px.clear();
    py.clear();
    for (int x = 0; x < 2 && x <= mx; x++) px.insert(x);
    for (int y = 0; y < 2 && y <= my; y++) py.insert(y);
    for (int x = mx; x >= 0 && x > mx - 2; x--) px.insert(x);
    for (int y = my; y >= 0 && y > my - 2; y--) py.insert(y);
    top = 0;
    for (set<int>::iterator itx = px.begin(); itx != px.end(); ++itx)
      for (set<int>::iterator ity = py.begin(); ity != py.end(); ++ity) {
        pp[top][0] = *itx;
        pp[top][1] = *ity;
        top++;
      }
    bans = 0;
    memset(used, 0, sizeof(used));
    go(0);
    for (int i = 0; i < 4; i++) printf("%d %d\n", pp[ans[i]][0], pp[ans[i]][1]);
  }
  return 0;
}
