#include <bits/stdc++.h>
using namespace std;
int GCD(int a, int b) {
  if (b == 0) return a;
  return (a % b == 0 ? b : GCD(b, a % b));
}
long long int POW(long long int base, long long int exp) {
  long long int val;
  val = 1;
  while (exp > 0) {
    if (exp % 2 == 1) {
      val = (val * base) % 1000000007;
    }
    base = (base * base) % 1000000007;
    exp = exp / 2;
  }
  return val;
}
int main() {
  int n, m;
  double v1, v2;
  scanf("%d%d", &n, &m);
  if (n == 0) {
    printf("%d %d\n", 0, 1);
    printf("%d %d\n", 0, m);
    printf("%d %d\n", 0, 0);
    printf("%d %d\n", 0, m - 1);
    return 0;
  }
  if (m == 0) {
    printf("%d %d\n", 1, 0);
    printf("%d %d\n", n, 0);
    printf("%d %d\n", 0, 0);
    printf("%d %d\n", n - 1, 0);
    return 0;
  }
  if (n > m) {
    v1 = n + 2.0 * sqrt(n * n + m * m);
    v2 = sqrt(n * n + m * m) + 2.0 * sqrt(n * n + (m - 1) * (m - 1));
    if (v1 > v2) {
      printf("%d %d\n", 0, 0);
      printf("%d %d\n", n, m);
      printf("%d %d\n", 0, m);
      printf("%d %d\n", n, 0);
    } else {
      printf("%d %d\n", 0, 1);
      printf("%d %d\n", n, m);
      printf("%d %d\n", 0, 0);
      printf("%d %d\n", n, m - 1);
    }
  } else {
    v1 = m + 2.0 * sqrt(n * n + m * m);
    v2 = sqrt(n * n + m * m) + 2.0 * sqrt(m * m + (n - 1) * (n - 1));
    if (v1 > v2) {
      printf("%d %d\n", 0, 0);
      printf("%d %d\n", n, m);
      printf("%d %d\n", n, 0);
      printf("%d %d\n", 0, m);
    } else {
      printf("%d %d\n", 1, 0);
      printf("%d %d\n", n, m);
      printf("%d %d\n", 0, 0);
      printf("%d %d\n", n - 1, m);
    }
  }
  return 0;
}
