#include <bits/stdc++.h>
using namespace std;
template <class T>
void print(vector<T> v) {
  cerr << "[";
  if (v.size()) cerr << v[0];
  for (int i = (1); i < (v.size()); ++i) cerr << ", " << v[i];
  cerr << "]\n";
}
template <class T>
string i2s(T x) {
  ostringstream o;
  o << x;
  return o.str();
}
vector<string> splt(string s, char c = ' ') {
  vector<string> all;
  int p = 0, np;
  while (np = s.find(c, p), np >= 0) {
    if (np != p) all.push_back(s.substr(p, np - p));
    p = np + 1;
  }
  if (p < s.size()) all.push_back(s.substr(p));
  return all;
}
int main() {
  set<pair<int, int> > st;
  int n, m;
  cin >> n >> m;
  for (int i = (0); i < (2); ++i)
    for (int j = (0); j < (2); ++j) {
      if (i <= n && j <= m) st.insert(make_pair(i, j));
      if (n - i >= 0 && m - j >= 0) st.insert(make_pair(n - i, m - j));
    }
  st.insert(make_pair(n, 0));
  st.insert(make_pair(0, m));
  vector<pair<int, int> > vp(st.begin(), st.end());
  vector<int> rv;
  double bd = 0;
  for (int i = (0); i < (vp.size()); ++i)
    for (int j = (0); j < (vp.size()); ++j)
      for (int k = (0); k < (vp.size()); ++k)
        for (int l = (0); l < (vp.size()); ++l)
          if (j != i && k != i && k != j && l != i && l != j && l != k) {
            double d = 0;
            d += hypot(vp[i].first - vp[j].first, vp[i].second - vp[j].second);
            d += hypot(vp[j].first - vp[k].first, vp[j].second - vp[k].second);
            d += hypot(vp[k].first - vp[l].first, vp[k].second - vp[l].second);
            if (d > bd) {
              bd = d;
              rv.clear();
              rv.push_back(i);
              rv.push_back(j);
              rv.push_back(k);
              rv.push_back(l);
            }
          }
  for (int i = (0); i < (4); ++i)
    cout << vp[rv[i]].first << ' ' << vp[rv[i]].second << endl;
  return 0;
}
