#include <bits/stdc++.h>
using namespace std;
double dist(double a, double b, double c, double d) {
  return sqrt((c - a) * (c - a) + (d - b) * (d - b));
}
int main() {
  int n, m;
  double nn, mm;
  scanf("%lf %lf", &nn, &mm);
  n = nn, m = mm;
  if (n == 0 || m == 0) {
    printf("%d %d\n%d %d\n0 0\n%d %d\n", n == 0 ? n : 1, n == 0 ? 1 : m, n, m,
           n == 0 ? n : n - 1, n == 0 ? m - 1 : m);
    return 0;
  }
  double a = dist(0.0, 0.0, nn, mm), b = (n >= m ? nn : mm),
         c = dist(0.0, 0.0, (n >= m ? nn : nn - 1), (n >= m ? mm - 1 : mm));
  if (a + b >= 2.0 * c) {
    printf("0 0\n%d %d\n%d %d\n%d %d\n", n, m, n > m ? 0 : n, n > m ? m : 0,
           n > m ? n : 0, n > m ? 0 : m);
  } else {
    printf("%d %d\n0 0\n%d %d\n%d %d\n", (n >= m ? n : n - 1),
           (n >= m ? m - 1 : m), n, m, (n >= m ? 0 : 1), (n >= m ? 1 : 0));
  }
  return 0;
}
