#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void smn(T &a, const T &b) {
  if (b < a) a = b;
}
template <class T>
inline void smx(T &a, const T &b) {
  if (b > a) a = b;
}
const double eps = 1e-8;
int n, m;
pair<int, int> p[4];
void check(vector<pair<int, int> > p2) {
  double l1 = 0, l2 = 0;
  for (int i = 1; i < 4; i++)
    l1 += sqrt(
        ((((p[i].first - p[i - 1].first)) * ((p[i].first - p[i - 1].first)))) +
        ((((p[i].second - p[i - 1].second)) *
          ((p[i].second - p[i - 1].second)))));
  for (int i = 1; i < 4; i++)
    l2 += sqrt(((((p2[i].first - p2[i - 1].first)) *
                 ((p2[i].first - p2[i - 1].first)))) +
               ((((p2[i].second - p2[i - 1].second)) *
                 ((p2[i].second - p2[i - 1].second)))));
  if (l2 >= l1 - eps)
    for (int i = 0; i < 4; i++) p[i] = p2[i];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  if (n == 0)
    p[0] = {0, m - 1}, p[1] = {0, 0}, p[2] = {0, m}, p[3] = {0, 1};
  else if (m == 0)
    p[0] = {n - 1, 0}, p[1] = {0, 0}, p[2] = {n, 0}, p[3] = {1, 0};
  else if (n <= m) {
    p[0] = {1, 0}, p[1] = {n, m}, p[2] = {0, 0}, p[3] = {n - 1, m};
    check({{0, 0}, {n, m}, {n, 0}, {0, m}});
  } else {
    p[0] = {0, 1}, p[1] = {n, m}, p[2] = {0, 0}, p[3] = {n, m - 1};
    check({{0, 0}, {n, m}, {0, m}, {n, 0}});
  }
  for (auto &x : p) cout << x.first << " " << x.second << '\n';
  return 0;
}
