#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  cin >> n >> m;
  if (n && m) {
    if (n == m) {
      if (n < 4) {
        cout << 0 << " " << 0 << endl;
        cout << n << " " << m << endl;
        cout << n << " " << 0 << endl;
        cout << 0 << " " << m << endl;
      } else {
        cout << 0 << " " << 1 << endl;
        cout << n << " " << m << endl;
        cout << 0 << " " << 0 << endl;
        cout << n - 1 << " " << m << endl;
      }
    } else {
      if (n < 4 || m < 4) {
        cout << 0 << " " << 0 << endl;
        cout << n << " " << m << endl;
        if (n > m) {
          cout << 0 << " " << m << endl;
          cout << n << " " << 0 << endl;
        } else {
          cout << n << " " << 0 << endl;
          cout << 0 << " " << m << endl;
        }
      } else {
        if (n < m) {
          cout << 1 << " " << 0 << endl;
          cout << n << " " << m << endl;
          cout << 0 << " " << 0 << endl;
          cout << n - 1 << " " << m << endl;
        } else {
          cout << 0 << " " << 1 << endl;
          cout << n << " " << m << endl;
          cout << 0 << " " << 0 << endl;
          cout << n << " " << m - 1 << endl;
        }
      }
    }
  } else if (n) {
    cout << 1 << " " << 0 << endl;
    cout << n << " " << 0 << endl;
    cout << 0 << " " << 0 << endl;
    cout << n - 1 << " " << 0 << endl;
  } else {
    cout << 0 << " " << 1 << endl;
    cout << 0 << " " << m << endl;
    cout << 0 << " " << 0 << endl;
    cout << 0 << " " << m - 1 << endl;
  }
  return 0;
}
