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.util.InputMismatchException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author HAL9000
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.readInt();
        int m = in.readInt();

        int[][] p = {{1,1},{0,0},{0,1},{1,0},{n,m},{n-1,m},{n,m-1},{n-1,m-1},{0,m},{n,0}};

        double ans = 0;
        int[][] ansp = {{0,0},{0,0},{0,0},{0,0}};
        for (int i1=0;i1<p.length;++i1)
            for (int i2=0;i2<p.length;++i2)
                for (int i3=0;i3<p.length;++i3)
                    for (int i4=0;i4<p.length;++i4) {
                        double len = getDist(p[i1],p[i2],p[i3],p[i4],n,m);
                        if (len > ans) {
                            ans = len;
                            ansp[0] = p[i1];
                            ansp[1] = p[i2];
                            ansp[2] = p[i3];
                            ansp[3] = p[i4];
                        }
                    }

        for (int i=0;i<4;++i)
            out.println(ansp[i][0] + " " + ansp[i][1]);

    }

    private double getDist(int[] p1, int[] p2, int[] p3, int[] p4, int n, int m) {
        if (eq(p1,p2) || eq(p1,p3) || eq(p1,p4) || eq(p2,p3) || eq(p2,p4) || eq(p3,p4))
            return -999999.0;
        if (inv(p1,n,m) || inv(p2,n,m) || inv(p3,n,m) || inv(p4,n,m))
            return -999999.0;
        double ret = Math.sqrt((p2[0]-p1[0])*(p2[0]-p1[0]) + (p2[1]-p1[1])*(p2[1]-p1[1]));
        ret += Math.sqrt((p3[0]-p2[0])*(p3[0]-p2[0]) + (p3[1]-p2[1])*(p3[1]-p2[1]));
        ret += Math.sqrt((p4[0]-p3[0])*(p4[0]-p3[0]) + (p4[1]-p3[1])*(p4[1]-p3[1]));
        return ret;
    }

    private boolean inv(int[] p, int n, int m) {
        return p[0] < 0 || p[0] > n || p[1] < 0 || p[1] > m;
    }

    private boolean eq(int[] p1, int[] p2) {
        return p1[0]==p2[0] && p1[1]==p2[1];
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

}