#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (n == 0) {
    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 if (m == 0) {
    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);
  } else {
    if (2 * sqrt(n * n + (m - 1) * (m - 1)) + sqrt(n * n + m * m) >=
            2 * sqrt(n * n + m * m) + max(n, m) &&
        2 * sqrt(n * n + (m - 1) * (m - 1)) + sqrt(n * n + m * m) >=
            2 * sqrt((n - 1) * (n - 1) + m * m) + sqrt(n * n + m * m)) {
      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 if (2 * sqrt((n - 1) * (n - 1) + m * m) + sqrt(n * n + m * m) >=
                   2 * sqrt(n * n + m * m) + max(n, m) &&
               2 * sqrt((n - 1) * (n - 1) + m * m) + sqrt(n * n + m * m) >=
                   2 * sqrt(n * n + (m - 1) * (m - 1)) + sqrt(n * n + m * m)) {
      printf("%d %d\n", n - 1, 0);
      printf("%d %d\n", 0, m);
      printf("%d %d\n", n, 0);
      printf("%d %d\n", 1, m);
    } else {
      if (n > m) {
        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, 0);
        printf("%d %d\n", n, m);
        printf("%d %d\n", n, 0);
        printf("%d %d\n", 0, m);
      }
    }
  }
  return 0;
}
