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