#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > s;
vector<pair<int, int> > p;
double dp[16][1 << 16];
int n, m;
double dist[16][16];
double calc(char i, int msk, char d) {
  if (d == 4) return 0;
  if (dp[i][msk] == dp[i][msk]) return dp[i][msk];
  dp[i][msk] = -1;
  for (int j = 0; j < p.size(); ++j)
    if (!((msk >> j) & 1))
      dp[i][msk] = max(dp[i][msk], dist[i][j] + calc(j, msk | (1 << j), d + 1));
  return dp[i][msk];
}
void print(char i, int msk, char d) {
  printf("%d %d\n", p[i].first, p[i].second);
  if (d == 4) return;
  for (int j = 0; j < p.size(); ++j)
    if (!((msk >> j) & 1) &&
        abs(dp[i][msk] - (dist[i][j] + calc(j, msk | (1 << j), d + 1))) <
            1e-8) {
      print(j, msk | (1 << j), d + 1);
      return;
    }
}
int main() {
  cin >> n >> m;
  int R[4] = {0, 0, n, n};
  int C[4] = {0, m, 0, m};
  int r, c, nr, nc;
  for (int i = 0; i < 4; ++i) {
    r = R[i];
    c = C[i];
    for (int i = 0; i < 4; ++i)
      for (int dr = -1; dr <= 1; ++dr)
        for (int dc = -1; dc <= 1; ++dc) {
          nr = r + dr;
          nc = c + dc;
          if (nr < 0 || nr > n || nc < 0 || nc > m) continue;
          s.insert(make_pair(nr, nc));
        }
  }
  memset(dp, -1, sizeof(dp));
  p.assign(s.begin(), s.end());
  for (int i = 0; i < p.size(); ++i)
    for (int j = 0; j < p.size(); ++j)
      dist[i][j] =
          sqrt((p[i].first - p[j].first) * (p[i].first - p[j].first) +
               (p[i].second - p[j].second) * (p[i].second - p[j].second));
  double res = -1;
  int idx;
  for (int i = 0; i < p.size(); ++i)
    if (res < calc(i, 1 << i, 1)) {
      res = calc(i, 1 << i, 1);
      idx = i;
    }
  print(idx, 1 << idx, 1);
  return 0;
}
