#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const double PI = atan(1.0) * 4;
const int inf = 2147483647 / 2;
template <class T>
bool chmin(T &a, const T &b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool chmax(T &a, const T &b) {
  return b > a ? a = b, 1 : 0;
}
template <class T>
int sgn(T first) {
  return (first > eps) - (first < -eps);
}
double dis(pair<int, int> a, pair<int, int> b) {
  return sqrt(((a.first - b.first) * (a.first - b.first)) +
              ((a.second - b.second) * (a.second - b.second)) + 0.0);
}
double calc(const vector<pair<int, int> > &v) {
  double ret = 0;
  for (int i = (1); i <= (int)(3); i++) ret += dis(v[i], v[i - 1]);
  return ret;
}
struct nod {
  vector<pair<int, int> > v;
  bool operator<(const nod &t) const { return calc(v) < calc(t.v); }
  void init(int n, int m) {
    v.resize(4);
    vector<pair<int, int> > tmp;
    tmp.resize(4);
    tmp[0] = make_pair(0, 0);
    tmp[1] = make_pair(n, m);
    tmp[2] = make_pair(0, m);
    tmp[3] = make_pair(n, 0);
    if (m != 1) {
      v[0] = make_pair(0, 1);
      v[1] = make_pair(n, m);
      v[2] = make_pair(0, 0);
      v[3] = make_pair(n, m - 1);
      if (calc(tmp) < calc(v)) tmp = v;
    }
    v = tmp;
  }
  void init2(int n, int m) {
    v.resize(4);
    vector<pair<int, int> > tmp;
    tmp.resize(4);
    tmp[0] = make_pair(0, 0);
    tmp[1] = make_pair(n, m);
    tmp[2] = make_pair(n, 0);
    tmp[3] = make_pair(0, m);
    if (n != 1) {
      v[0] = make_pair(n - 1, m);
      v[1] = make_pair(0, 0);
      v[2] = make_pair(n, m);
      v[3] = make_pair(1, 0);
      if (calc(tmp) < calc(v)) tmp = v;
    }
    v = tmp;
  }
};
nod gao(int n, int m) {
  nod ret, tmp;
  ret.init(n, m);
  tmp.v.resize(4);
  if (n > 1) {
    tmp.v[0] = make_pair(1, 0);
    tmp.v[1] = make_pair(n, 0);
    tmp.v[2] = make_pair(0, 0);
    tmp.v[3] = make_pair(n - 1, 0);
    if (!m)
      ret = tmp;
    else if (ret < tmp)
      ret = tmp;
  }
  if (m > 1) {
    tmp.v[0] = make_pair(0, 1);
    tmp.v[1] = make_pair(0, m);
    tmp.v[2] = make_pair(0, 0);
    tmp.v[3] = make_pair(0, m - 1);
    if (!n)
      ret = tmp;
    else if (ret < tmp)
      ret = tmp;
  }
  if (!m || !n) return ret;
  tmp.init(n, m);
  if (ret < tmp) ret = tmp;
  tmp.init2(n, m);
  if (ret < tmp) ret = tmp;
  return ret;
}
int main() {
  int n, m;
  while (cin >> n >> m) {
    nod ans = gao(n, m);
    for (auto i : ans.v) printf("%d %d\n", i.first, i.second);
  }
  return 0;
}
