#include <bits/stdc++.h>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
using std::fixed;
using std::ios_base;
using std::make_pair;
using std::map;
using std::max;
using std::min;
using std::ostream;
using std::pair;
using std::set;
using std::setprecision;
using std::string;
using std::vector;
template <class C>
void mini(C& a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C& a4, C b4) {
  a4 = max(a4, b4);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> pair) {
  return out << "(" << pair.first << ", " << pair.second << ")";
}
struct Point {
  int y, x;
  Point(int y_, int x_) : y(y_), x(x_) {}
  Point() : Point(-1, -1) {}
};
double Dis(Point a, Point b) {
  int dx = a.x - b.x;
  int dy = a.y - b.y;
  return sqrt(1.0 * dx * dx + 1.0 * dy * dy);
}
int main() {
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  double beg = 1.0 * clock() / CLOCKS_PER_SEC;
  int n, m;
  cin >> n >> m;
  ;
  set<pair<int, int> > secik;
  double best = 0;
  vector<int> res;
  int DUPA = 6;
  for (int x1 = 0; x1 < (min(n + 1, DUPA)); ++x1) {
    for (int y1 = 0; y1 < (min(m + 1, DUPA)); ++y1) {
      for (int x2 = 0; x2 < (min(n + 1, DUPA)); ++x2) {
        for (int y2 = 0; y2 < (min(m + 1, DUPA)); ++y2) {
          for (int x3 = 0; x3 < (min(n + 1, DUPA)); ++x3) {
            for (int y3 = 0; y3 < (min(m + 1, DUPA)); ++y3) {
              for (int x4 = 0; x4 < (min(n + 1, DUPA)); ++x4) {
                for (int y4 = 0; y4 < (min(m + 1, DUPA)); ++y4) {
                  secik.clear();
                  secik.insert(make_pair(x1, y1));
                  secik.insert(make_pair(n - x2, m - y2));
                  secik.insert(make_pair(x3, y3));
                  secik.insert(make_pair(n - x4, m - y4));
                  if (secik.size() != 4) {
                    continue;
                  }
                  Point p1(x1, y1), p2(n - x2, m - y2), p3(x3, y3),
                      p4(n - x4, m - y4);
                  double d = Dis(p1, p2) + Dis(p2, p3) + Dis(p3, p4);
                  if (d > best) {
                    best = d;
                    res.clear();
                    res.push_back(x1);
                    res.push_back(y1);
                    res.push_back(n - x2);
                    res.push_back(m - y2);
                    res.push_back(x3);
                    res.push_back(y3);
                    res.push_back(n - x4);
                    res.push_back(m - y4);
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  cerr << best << endl;
  for (auto a : res) {
    cout << a << " ";
  }
  cout << endl;
  return 0;
}
