#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  int y;
  vector<pair<int, int> > v;
  cin >> x >> y;
  if (x == 0 || y == 0) {
    if (x == 0) {
      v.push_back(make_pair(0, 1));
      v.push_back(make_pair(0, y));
      v.push_back(make_pair(0, 0));
      v.push_back(make_pair(0, y - 1));
    }
    if (y == 0) {
      v.push_back(make_pair(1, 0));
      v.push_back(make_pair(x, 0));
      v.push_back(make_pair(0, 0));
      v.push_back(make_pair(x - 1, 0));
    }
    for (int i = 0; (i) < (v.size()); ++i)
      cout << v[i].first << " " << v[i].second << "\n";
    return 0;
  }
  if (x > y) {
    vector<pair<int, int> > o, w;
    double a, b;
    a = 2 * sqrt(x * x + y * y) + x;
    b = sqrt(x * x + y * y) + 2 * sqrt(x * x + (y - 1) * (y - 1));
    if (b > a) {
      v.push_back(make_pair(0, 1));
      v.push_back(make_pair(x, y));
      v.push_back(make_pair(0, 0));
      v.push_back(make_pair(x, y - 1));
      for (int i = 0; (i) < (v.size()); ++i)
        cout << v[i].first << " " << v[i].second << "\n";
      return 0;
    } else {
      v.push_back(make_pair(0, 0));
      v.push_back(make_pair(x, y));
      v.push_back(make_pair(0, y));
      v.push_back(make_pair(x, 0));
      for (int i = 0; (i) < (v.size()); ++i)
        cout << v[i].first << " " << v[i].second << "\n";
      return 0;
    }
  } else {
    vector<pair<int, int> > o, w;
    double a, b;
    a = 2 * sqrt(x * x + y * y) + y;
    b = sqrt(x * x + y * y) + 2 * sqrt(y * y + (x - 1) * (x - 1));
    if (b > a) {
      v.push_back(make_pair(1, 0));
      v.push_back(make_pair(x, y));
      v.push_back(make_pair(0, 0));
      v.push_back(make_pair(x - 1, y));
      for (int i = 0; (i) < (v.size()); ++i)
        cout << v[i].first << " " << v[i].second << "\n";
      return 0;
    } else {
      v.push_back(make_pair(0, 0));
      v.push_back(make_pair(x, y));
      v.push_back(make_pair(x, 0));
      v.push_back(make_pair(0, y));
      for (int i = 0; (i) < (v.size()); ++i)
        cout << v[i].first << " " << v[i].second << "\n";
      return 0;
    }
  }
}
