#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
int n, m;
inline bool check(int x, int y) { return 0 <= x && x <= n && 0 <= y && y <= m; }
inline double dist(int x1, int y1, int x2, int y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  vector<pair<int, int> > tr, q;
  tr.push_back(make_pair(0, 0));
  tr.push_back(make_pair(n, m));
  tr.push_back(make_pair(n, 0));
  tr.push_back(make_pair(0, m));
  for (auto it : tr) {
    q.push_back(it);
    for (int i = 0; i < 4; i++) {
      int x = it.first + dx[i], y = it.second + dy[i];
      if (check(x, y)) {
        q.push_back(make_pair(x, y));
      }
    }
  }
  double ans = 0;
  pair<int, int> ans1, ans2, ans3, ans4;
  for (int i = 0; i < (int)q.size(); i++) {
    for (int j = 0; j < (int)q.size(); j++) {
      for (int k = 0; k < (int)q.size(); k++) {
        for (int l = 0; l < (int)q.size(); l++) {
          set<pair<int, int> > s;
          s.insert(q[i]);
          s.insert(q[j]);
          s.insert(q[k]);
          s.insert(q[l]);
          if ((int)s.size() != 4) {
            continue;
          }
          double val = 0;
          val += dist(q[i].first, q[i].second, q[j].first, q[j].second);
          val += dist(q[j].first, q[j].second, q[k].first, q[k].second);
          val += dist(q[k].first, q[k].second, q[l].first, q[l].second);
          if (val > ans) {
            ans = val;
            ans1 = q[i];
            ans2 = q[j];
            ans3 = q[k];
            ans4 = q[l];
          }
        }
      }
    }
  }
  cout << ans1.first << " " << ans1.second << "\n";
  cout << ans2.first << " " << ans2.second << "\n";
  cout << ans3.first << " " << ans3.second << "\n";
  cout << ans4.first << " " << ans4.second << "\n";
}
