#include <bits/stdc++.h>
using namespace std;
int main() {
  int sw = 0;
  int n, m;
  cin >> n >> m;
  if (n < m) {
    sw = 1;
    swap(n, m);
  }
  int x = n;
  int y = m;
  double d1 = 2 * sqrt(n * n + m * m) + n;
  double d2 = 2 * sqrt(x * x + (y - 1) * (y - 1)) + sqrt(x * x + y * y);
  if (y == 0) d2 = 0;
  double d3 = 2 * sqrt(y * y + (x - 1) * (x - 1)) + sqrt(x * x + y * y);
  if (x == 0) d3 = 0;
  if (d1 > d2 && d1 > d3 && m > 0) {
    if (sw == 0) {
      cout << n << " " << m << endl;
      cout << 0 << " " << 0 << endl;
      cout << n << " " << 0 << endl;
      cout << 0 << " " << m << endl;
    } else {
      cout << m << " " << n << endl;
      cout << 0 << " " << 0 << endl;
      cout << 0 << " " << n << endl;
      cout << m << " " << 0 << endl;
    }
    return 0;
  }
  if (y) {
    if (sw == 0) {
      cout << 0 << " " << 1 << endl;
      cout << n << " " << m << endl;
      cout << 0 << " " << 0 << endl;
      cout << n << " " << m - 1 << endl;
    } else {
      cout << 1 << " " << 0 << endl;
      cout << m << " " << n << endl;
      cout << 0 << " " << 0 << endl;
      cout << m - 1 << " " << n << endl;
    }
    return 0;
  }
  if (sw == 0) {
    cout << 1 << " " << 0 << endl;
    cout << n << " " << m << endl;
    cout << 0 << " " << 0 << endl;
    cout << n - 1 << " " << m << endl;
  } else {
    cout << 0 << " " << 1 << endl;
    cout << m << " " << n << endl;
    cout << 0 << " " << 0 << endl;
    cout << m << " " << n - 1 << endl;
  }
  return 0;
}
