#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  double a, b;
  cin >> n >> m;
  if (n >= m) {
    a = 2 * sqrt(n * n + m * m) + n;
    b = sqrt(n * n + m * m) + 2 * sqrt(n * n + (m - 1) * (m - 1));
  } else {
    a = 2 * sqrt(n * n + m * m) + m;
    b = sqrt(n * n + m * m) + 2 * sqrt(m * m + (n - 1) * (n - 1));
  }
  if (n == 0) {
    cout << "0 1" << endl;
    cout << "0 " << m << endl;
    cout << "0 0" << endl;
    cout << "0 " << m - 1 << endl;
  } else if (m == 0) {
    cout << "1 0" << endl;
    cout << n << " 0" << endl;
    cout << "0 0" << endl;
    cout << n - 1 << " 0" << endl;
  } else if (m == 1) {
    cout << n << " " << m << endl;
    cout << "0 0" << endl;
    cout << n << " 0" << endl;
    cout << "0 " << m << endl;
  } else if (n == 1) {
    cout << n << " " << m << endl;
    cout << "0 0" << endl;
    cout << "0 " << m << endl;
    cout << n << " 0" << endl;
  } else if (n >= m) {
    if (a > b) {
      cout << n << " " << m << endl;
      cout << "0 0" << endl;
      cout << n << " 0" << endl;
      cout << "0 " << m << endl;
    } else {
      cout << "0 1" << endl;
      cout << n << " " << m << endl;
      cout << "0 0" << endl;
      cout << n << " " << m - 1 << endl;
    }
  } else {
    if (a > b) {
      cout << n << " " << m << endl;
      cout << "0 0" << endl;
      cout << "0 " << m << endl;
      cout << n << " 0" << endl;
    } else {
      cout << "1 0" << endl;
      cout << n << " " << m << endl;
      cout << "0 0" << endl;
      cout << n - 1 << " " << m << endl;
    }
  }
  return 0;
}
