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