#include <bits/stdc++.h>
using namespace std;
const int INF = 0X3F3F3F3F;
const double PI = acos(-1.0);
const double EPS = 1e-8;
const int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};
inline int sgn(double x) { return x < -EPS ? -1 : x > EPS ? 1 : 0; }
template <class T>
inline T sqr(const T& x) {
  return x * x;
}
template <class T>
inline int toint(const T& x) {
  stringstream ss;
  ss << x;
  int r;
  ss >> r;
  return r;
}
template <class T>
inline int todouble(const T& x) {
  stringstream ss;
  ss << x;
  double r;
  ss >> r;
  return r;
}
template <class T>
inline string tostr(const T& x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
inline string tolower(string s) {
  for (int i = 0; i < (int)(s.size()); ++i) s[i] = tolower(s[i]);
  return s;
}
inline string toupper(string s) {
  for (int i = 0; i < (int)(s.size()); ++i) s[i] = toupper(s[i]);
  return s;
}
template <class T>
vector<T> split(string s, char c = ' ') {
  stringstream ss(s);
  vector<T> res;
  T t;
  while (ss >> t) {
    res.push_back(t);
    if (ss.peek() == c) ss.ignore();
  }
  return res;
}
template <class T>
vector<T> stov(string s) {
  vector<T> vi;
  stringstream ss(s);
  T v;
  while (ss >> v) vi.push_back(v);
  return vi;
}
template <class T>
string vtos(const vector<T>& vi) {
  stringstream ss;
  for (int i = 0; i < (int)(vi.size()); ++i) {
    if (i > 0) ss << ' ';
    ss << vi[i];
  }
  return ss.str();
}
template <class T>
inline T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
inline vector<pair<T, int> > factorize(T n) {
  vector<pair<T, int> > R;
  for (T i = 2; n > 1;) {
    if (n % i == 0) {
      int C = 0;
      while (n % i == 0) C++, n /= i;
      R.push_back(make_pair(i, C));
    }
    i++;
    if (i > n / i) i = n;
  }
  if (n > 1) R.push_back(make_pair(n, 1));
  return R;
}
template <class T>
inline bool isprime(T n) {
  if (n < 2) return false;
  for (T i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
template <class T>
inline T phi(T n) {
  vector<pair<T, int> > R = factorize(n);
  T r = n;
  for (int i = 0; i < (int)(R.size()); ++i)
    r = r / R[i].first * (R[i].first - 1);
  return r;
}
struct P {
  int x, y;
  P(int _x = 0, int _y = 0) : x(_x), y(_y) {}
  friend double dist(const P& p1, const P& p2) {
    return sqrt(double(p1.x - p2.x) * (p1.x - p2.x) +
                double(p1.y - p2.y) * (p1.y - p2.y));
  }
  void out() { printf("%d %d\n", x, y); }
};
int main() {
  int n, m;
  while (cin >> n >> m) {
    if (n == 0) {
      P(0, 1).out();
      P(0, m).out();
      P(0, 0).out();
      P(0, m - 1).out();
    } else if (m == 0) {
      P(1, 0).out();
      P(n, 0).out();
      P(0, 0).out();
      P(n - 1, 0).out();
    } else {
      if (n < m) {
        if (sgn(sqrt(m * m + n * n) + m - 2 * sqrt(m * m + (n - 1) * (n - 1))) >
            0) {
          P(0, 0).out();
          P(n, m).out();
          P(n, 0).out();
          P(0, m).out();
        } else {
          P(1, 0).out();
          P(n, m).out();
          P(0, 0).out();
          P(n - 1, m).out();
        }
      } else {
        if (sgn(sqrt(m * m + n * n) + n - 2 * sqrt(n * n + (m - 1) * (m - 1))) >
            0) {
          P(0, 0).out();
          P(n, m).out();
          P(0, m).out();
          P(n, 0).out();
        } else {
          P(0, 1).out();
          P(n, m).out();
          P(0, 0).out();
          P(n, m - 1).out();
        }
      }
    }
  }
}
