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.awt.Point;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class FourPointPolyline {
    static int n, m;

    static double distance(Point p1, Point p2) {
        double dx = p1.x - p2.x;
        double dy = p1.y - p2.y;
        return Math.sqrt(dx * dx + dy * dy);
    }

    static double bruteForce() {
        double res = 0;
        Point[] points = new Point[(n + 1) * (m + 1)];
        int k = 0;
        for (int i = 0; i <= n; i++)
            for (int j = 0; j <= m; j++)
                points[k++] = new Point(i, j);
        for (Point p1 : points) {
            for (Point p2 : points) {
                for (Point p3 : points) {
                    for (Point p4 : points) {
                        if (p1 == p2 || p1 == p3 || p1 == p4)
                            continue;
                        if (p2 == p3 || p2 == p4)
                            continue;
                        if (p3 == p4)
                            continue;
                        double p1p2 = distance(p1, p2);
                        double p2p3 = distance(p3, p2);
                        double p3p4 = distance(p3, p4);
                        double temp = p1p2 + p2p3 + p3p4;
                        if (temp > res) {
                            res = temp;
                        }
                    }
                }
            }
        }
        for (Point p1 : points) {
            for (Point p2 : points) {
                for (Point p3 : points) {
                    for (Point p4 : points) {
                        if (p1 == p2 || p1 == p3 || p1 == p4)
                            continue;
                        if (p2 == p3 || p2 == p4)
                            continue;
                        if (p3 == p4)
                            continue;
                        double p1p2 = distance(p1, p2);
                        double p2p3 = distance(p3, p2);
                        double p3p4 = distance(p3, p4);
                        double temp = p1p2 + p2p3 + p3p4;
                        if (temp == res) {
                            System.out.println(p1.x + " " + p1.y);
                            System.out.println(p2.x + " " + p2.y);
                            System.out.println(p3.x + " " + p3.y);
                            System.out.println(p4.x + " " + p4.y);
                            return res;
                        }
                    }
                }
            }
        }
        return res;
    }

    public static void main(String[] args) {
        InputReader r = new InputReader(System.in);
        n = r.nextInt();
        m = r.nextInt();
//      double res = bruteForce();
//      System.out.println(n + " " + m + " " + res);
        if (n == 0) {
            System.out.println("0 1");
            System.out.println("0 " + m);
            System.out.println("0 0");
            System.out.println("0 " + (m - 1));
        } else if (m == 0) {
            System.out.println("1 0");
            System.out.println(n + " 0");
            System.out.println("0 0");
            System.out.println((n - 1) + " 0");
        } else {
            double temp1 = try1();
            double temp2 = try2();
            double temp3 = try3();
            double temp4 = try4();
            double resDist = Math.max(Math.max(temp1,temp4), Math.max(temp2, temp3));
            if (Double.compare(temp1, resDist) == 0)
                print1();
            else if (Double.compare(temp2, resDist) == 0)
                print2();
            else if(Double.compare(temp3,resDist)==0)
                print3();
            else
                print4();
        }
    }

    static double try1() {
        Point p1 = new Point(0, 0);
        Point p2 = new Point(n, m);
        Point p3 = new Point(0, m);
        Point p4 = new Point(n, 0);
        double p1p2 = distance(p1, p2);
        double p2p3 = distance(p3, p2);
        double p3p4 = distance(p3, p4);
        double temp1 = p1p2 + p2p3 + p3p4;
        return temp1;
    }

    static double try2() {
        Point p1 = new Point(0, 0);
        Point p2 = new Point(n, m);
        Point p3 = new Point(n, 0);
        Point p4 = new Point(0, m);
        double p1p2 = distance(p1, p2);
        double p2p3 = distance(p3, p2);
        double p3p4 = distance(p3, p4);
        double temp1 = p1p2 + p2p3 + p3p4;
        return temp1;
    }

    static double d(Point p1, Point p2, Point p3, Point p4) {
        double p1p2 = distance(p1, p2);
        double p2p3 = distance(p3, p2);
        double p3p4 = distance(p3, p4);
        double temp1 = p1p2 + p2p3 + p3p4;
        return temp1;
    }

    static double try3() {
        Point p1 = new Point(0, 1);
        Point p2 = new Point(n, m);
        Point p3 = new Point(0, 0);
        Point p4 = new Point(n, m - 1);
        double p1p2 = distance(p1, p2);
        double p2p3 = distance(p3, p2);
        double p3p4 = distance(p3, p4);
        double temp1 = p1p2 + p2p3 + p3p4;
        return temp1;
    }
    static double try4() {
        Point p1 = new Point(1, 0);
        Point p2 = new Point(n, m);
        Point p3 = new Point(0, 0);
        Point p4 = new Point(n-1, m);
        double p1p2 = distance(p1, p2);
        double p2p3 = distance(p3, p2);
        double p3p4 = distance(p3, p4);
        double temp1 = p1p2 + p2p3 + p3p4;
        return temp1;
    }
    static void print4(){
        Point p1 = new Point(1, 0);
        Point p2 = new Point(n, m);
        Point p3 = new Point(0, 0);
        Point p4 = new Point(n-1, m);
        System.out.println(p1.x + " " + p1.y);
        System.out.println(p2.x + " " + p2.y);
        System.out.println(p3.x + " " + p3.y);
        System.out.println(p4.x + " " + p4.y);
    }

    static void print3() {
        Point p1 = new Point(0, 1);
        Point p2 = new Point(n, m);
        Point p3 = new Point(0, 0);
        Point p4 = new Point(n, m - 1);
        System.out.println(p1.x + " " + p1.y);
        System.out.println(p2.x + " " + p2.y);
        System.out.println(p3.x + " " + p3.y);
        System.out.println(p4.x + " " + p4.y);
    }

    static void print1() {
        Point p1 = new Point(0, 0);
        Point p2 = new Point(n, m);
        Point p3 = new Point(0, m);
        Point p4 = new Point(n, 0);
        System.out.println(p1.x + " " + p1.y);
        System.out.println(p2.x + " " + p2.y);
        System.out.println(p3.x + " " + p3.y);
        System.out.println(p4.x + " " + p4.y);
    }

    static void print2() {
        Point p1 = new Point(0, 0);
        Point p2 = new Point(n, m);
        Point p3 = new Point(n, 0);
        Point p4 = new Point(0, m);
        System.out.println(p1.x + " " + p1.y);
        System.out.println(p2.x + " " + p2.y);
        System.out.println(p3.x + " " + p3.y);
        System.out.println(p4.x + " " + p4.y);
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public InputReader(FileReader stream) {
            reader = new BufferedReader(stream);
            tokenizer = null;
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                return null;
            }
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
    }
}