#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const int N = 101000;
const int INF = 1 << 30;
const int MOD = (1 << 20) - 1;
const int HMOD = int(1e9) + 7;
int x[10];
int y[10];
int resx[10];
int resy[10];
bool Eq(int x1, int y1, int x2, int y2) {
  return x[x1] == x[x2] && y[y1] == y[y2];
}
double GetLen(int x1, int y1, int x2, int y2) {
  return sqrt((double)(x[x2] - x[x1]) * (x[x2] - x[x1]) +
              (y[y2] - y[y1]) * (y[y2] - y[y1]));
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  if (n == 0) {
    printf("%d %d\n%d %d\n%d %d\n%d %d\n", 0, 1, 0, m, 0, 0, 0, m - 1);
    return 0;
  }
  if (m == 0) {
    printf("%d %d\n%d %d\n%d %d\n%d %d\n", 1, 0, n, 0, 0, 0, n - 1, 0);
    return 0;
  }
  double maxRes = 0;
  x[0] = 0;
  x[1] = 1;
  x[2] = n;
  x[3] = n - 1;
  y[0] = 0;
  y[1] = 1;
  y[2] = m;
  y[3] = m - 1;
  for (int x1 = 0; x1 < 4; x1++)
    for (int y1 = 0; y1 < 4; y1++)
      for (int x2 = 0; x2 < 4; x2++)
        for (int y2 = 0; y2 < 4; y2++)
          for (int x3 = 0; x3 < 4; x3++)
            for (int y3 = 0; y3 < 4; y3++)
              for (int x4 = 0; x4 < 4; x4++)
                for (int y4 = 0; y4 < 4; y4++) {
                  if (Eq(x1, y1, x2, y2) || Eq(x1, y1, x3, y3) ||
                      Eq(x1, y1, x4, y4) || Eq(x2, y2, x3, y3) ||
                      Eq(x2, y2, x4, y4) || Eq(x3, y3, x4, y4))
                    continue;
                  double len = GetLen(x1, y1, x2, y2) + GetLen(x2, y2, x3, y3) +
                               GetLen(x3, y3, x4, y4);
                  if (len > maxRes) {
                    maxRes = len;
                    resx[0] = x1;
                    resx[1] = x2;
                    resx[2] = x3;
                    resx[3] = x4;
                    resy[0] = y1;
                    resy[1] = y2;
                    resy[2] = y3;
                    resy[3] = y4;
                  }
                }
  for (int i = 0; i < 4; i++) {
    printf("%d %d\n", x[resx[i]], y[resy[i]]);
  }
  return 0;
}
