#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, m, t, x, y, z, z2, w;
  cin >> n >> m;
  if ((n == 1) && (m >= 1)) {
    cout << 1 << " " << m << "\n";
    cout << 0 << " " << 0 << "\n";
    cout << 0 << " " << m << "\n";
    cout << 1 << " " << 0 << "\n";
  } else {
    if (n == 0) {
      cout << 0 << " " << 1 << "\n";
      cout << 0 << " " << m << "\n";
      cout << 0 << " " << 0 << "\n";
      cout << 0 << " " << m - 1 << "\n";
    } else {
      if (m == 0) {
        cout << 1 << " " << 0 << "\n";
        cout << n << " " << 0 << "\n";
        cout << 0 << " " << 0 << "\n";
        cout << n - 1 << " " << 0 << "\n";
      } else {
        x = max(n, m);
        w = min(n, m);
        y = n * n + m * m;
        y = sqrt(y);
        y *= 2;
        y += x;
        z = n * n + m * m;
        z = sqrt(z);
        z2 = (w - 1) * (w - 1) + (x) * (x);
        z2 = sqrt(z2);
        z2 *= 2;
        z += z2;
        if (z > y) {
          if (m > n) {
            cout << 1 << " " << 0 << "\n";
            cout << n << " " << m << "\n";
            cout << 0 << " " << 0 << "\n";
            cout << n - 1 << " " << m << "\n";
          } else {
            cout << 0 << " " << 1 << "\n";
            cout << n << " " << m << "\n";
            cout << 0 << " " << 0 << "\n";
            cout << n << " " << m - 1 << "\n";
          }
        } else {
          if (m > n) {
            cout << n << " " << m << "\n";
            cout << 0 << " " << 0 << "\n";
            cout << 0 << " " << m << "\n";
            cout << n << " " << 0 << "\n";
          } else {
            cout << n << " " << m << "\n";
            cout << 0 << " " << 0 << "\n";
            cout << n << " " << 0 << "\n";
            cout << 0 << " " << m << "\n";
          }
        }
      }
    }
  }
  return 0;
}
