#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
long double dist(vector<pair<int, int> > v1) {
  long double ans = 0;
  for (int(i) = 0; (i) < (3); (i)++) {
    long double x = v1[i].first - v1[i + 1].first;
    long double y = v1[i].second - v1[i + 1].second;
    x *= x;
    y *= y;
    ans += sqrt(x + y);
  }
  return ans;
}
int comp(vector<pair<int, int> > v1, vector<pair<int, int> > v2) {
  return dist(v1) > dist(v2);
}
vector<vector<pair<int, int> > > v;
int N, M;
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cin >> N >> M;
  int k = 1;
  vector<int> ns;
  for (int(i) = 0; (i) < (min(k, N) + 1); (i)++) ns.push_back(i);
  for (int(i) = 0; (i) < (min(k, N) + 1); (i)++) ns.push_back(max(0, N - i));
  vector<int> ms;
  for (int(i) = 0; (i) < (min(k, M) + 1); (i)++) ms.push_back(i);
  for (int(i) = 0; (i) < (min(k, M) + 1); (i)++) ms.push_back(max(0, M - i));
  for (int(i1) = 0; (i1) < (ns.size()); (i1)++)
    for (int(j1) = 0; (j1) < (ms.size()); (j1)++)
      for (int(i2) = 0; (i2) < (ns.size()); (i2)++)
        for (int(j2) = 0; (j2) < (ms.size()); (j2)++)
          for (int(i3) = 0; (i3) < (ns.size()); (i3)++)
            for (int(j3) = 0; (j3) < (ms.size()); (j3)++)
              for (int(i4) = 0; (i4) < (ns.size()); (i4)++)
                for (int(j4) = 0; (j4) < (ms.size()); (j4)++) {
                  vector<pair<int, int> > v1;
                  v1.push_back(make_pair(ns[i1], ms[j1]));
                  v1.push_back(make_pair(ns[i2], ms[j2]));
                  v1.push_back(make_pair(ns[i3], ms[j3]));
                  v1.push_back(make_pair(ns[i4], ms[j4]));
                  int flag = 1;
                  for (int(i) = 0; (i) < (4); (i)++)
                    for (int(j) = 0; (j) < (4); (j)++)
                      if (i < j)
                        if (v1[i] == v1[j]) flag = 0;
                  if (flag) v.push_back(v1);
                }
  sort(v.begin(), v.end(), comp);
  for (int(i) = 0; (i) < (4); (i)++)
    cout << v[0][i].first << ' ' << v[0][i].second << '\n';
}
