Problem: You are given a rectangular grid of lattice points from (0, 0) to (n, m) inclusive. You have to choose exactly 4 different points to build a polyline possibly with self-intersections and self-touching. This polyline should be as long as possible.

A polyline defined by points p1, p2, p3, p4 consists of the line segments p1 p2, p2 p3, p3 p4, and its length is the sum of the lengths of the individual line segments.

Input

The only line of the input contains two integers n and m (0 ≤ n, m ≤ 1000). It is guaranteed that grid contains at least 4 different points.

Output

Print 4 lines with two integers per line separated by space — coordinates of points p1, p2, p3, p4 in order which represent the longest possible polyline.

Judge program compares your answer and jury's answer with 10 - 6 precision.

Examples

Input

1 1


Output

1 1
0 0
1 0
0 1


Input

0 10


Output

0 1
0 10
0 0
0 9

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B {
    public static void main(String[] args) {
        new B().run();
    }

    BufferedReader br;
    StringTokenizer in;
    PrintWriter out;

    public String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public double dist(int x1, int y1, int x2, int y2) {
        return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
    }

    public void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();

        if (n == 0) {
            out.println(0 + " " + 1);
            out.println(0 + " " + m);
            out.println(0 + " " + 0);
            out.println(0 + " " + (m - 1));
            return;
        }
        if (m == 0) {
            out.println(1 + " " + 0);
            out.println(n + " " + 0);
            out.println(0 + " " + 0);
            out.println((n - 1) + " " + 0);
            return;
        }


        int[][] x = new int[4][4];
        int[][] y = new int[4][4];
        double[] d = new double[4];
        for (int i = 0; i < 2; i++) {
            x[i][0] = 0;
            y[i][0] = 0;

            x[i][1] = n;
            y[i][1] = m;

            x[i][3] = n;
            y[i][3] = 0;

            for (int xx = 0; xx <= n; xx++) {
                for (int yy = 0; yy <= m; yy++) {
                    boolean take = false;
                    for (int j = 0; j < 4; j++) {
                        if (x[i][j] == xx && y[i][j] == yy)
                            take = true;
                    }
                    if (take)
                        continue;
                    double dd = dist(n, m, xx, yy) + dist(n, 0, xx, yy);
                    if (dd > d[i]) {
                        d[i] = dd;
                        x[i][2] = xx;
                        y[i][2] = yy;
                    }
                }
            }

            d[i] = 0;
            int p = n;
            n = m;
            m = p;
        }

        for (int i = 0; i < 4; i++) {
            int p = x[1][i];
            x[1][i] = y[1][i];
            y[1][i] = p;
        }

        x[2][0] = n - 1;
        y[2][0] = m;
        x[2][1] = 0;
        y[2][1] = 0;
        x[2][2] = n;
        y[2][2] = m;
        x[2][3] = 1;
        y[2][3] = 0;

        x[3][0] = n;
        y[3][0] = m - 1;
        x[3][1] = 0;
        y[3][1] = 0;
        x[3][2] = n;
        y[3][2] = m;
        x[3][3] = 0;
        y[3][3] = 1;


        int b = 0;
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 3; j++) {
                d[i] += dist(x[i][j], y[i][j], x[i][j + 1], y[i][j + 1]);
            }
            if (d[i] > d[b])
                b = i;
        }

        for (int i = 0; i < 4; i++) {
            out.println(x[b][i] + " " + y[b][i]);
        }

    }

    public void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}