#include <bits/stdc++.h>
using namespace std;
int m, n;
int MAX(int x, int y) {
  if (x > y)
    return x;
  else
    return y;
}
int main() {
  int x[5], y[5];
  while (~scanf("%d%d", &n, &m)) {
    if (n == 0 && m != 0) {
      x[1] = 0;
      y[1] = 1;
      x[2] = 0;
      y[2] = m;
      x[3] = 0;
      y[3] = 0;
      x[4] = 0;
      y[4] = m - 1;
    } else if (m == 0 && n != 0) {
      x[1] = 1;
      y[1] = 0;
      x[2] = n;
      y[2] = 0;
      x[3] = 0;
      y[3] = 0;
      x[4] = n - 1;
      y[4] = 0;
    } else if (n != 0 && m != 0) {
      if (n >= m) {
        if (sqrt(n * n + m * m) + MAX(n, m) >
            (2 * sqrt((m - 1) * (m - 1) + n * n))) {
          x[1] = n;
          y[1] = m;
          x[2] = 0;
          y[2] = 0;
          x[3] = n;
          y[3] = 0;
          x[4] = 0;
          y[4] = m;
        } else {
          x[1] = 0;
          y[1] = 1;
          x[2] = n;
          y[2] = m;
          x[3] = 0;
          y[3] = 0;
          x[4] = n;
          y[4] = m - 1;
        }
      } else if (n < m) {
        if (sqrt(n * n + m * m) + MAX(n, m) >
            (2 * sqrt((n - 1) * (n - 1) + m * m))) {
          x[1] = 0;
          y[1] = 0;
          x[2] = n;
          y[2] = m;
          x[3] = n;
          y[3] = 0;
          x[4] = 0;
          y[4] = m;
        } else {
          x[1] = n - 1;
          y[1] = m;
          x[2] = 0;
          y[2] = 0;
          x[3] = n;
          y[3] = m;
          x[4] = 1;
          y[4] = 0;
        }
      }
    }
    for (int i = 1; i <= 4; i++) {
      cout << x[i] << " " << y[i] << endl;
    }
  }
  return 0;
}
