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.*;
import java.util.*;

public class B {

    public static final double EPS = 1e-9;

    static class Point {
        int x, y;

        Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Point point = (Point) o;

            if (x != point.x) return false;
            if (y != point.y) return false;

            return true;
        }

        @Override
        public int hashCode() {
            int result = x;
            result = 31 * result + y;
            return result;
        }

        @Override
        public String toString() {
            return x + " " + y;
        }

        public double distTo(Point p) {
            return Math.sqrt((p.x - x) * (p.x - x) + (p.y - y) * (p.y - y));
        }
    }

    static Point p(int x, int y) {
        return new Point(x, y);
    }

    public static Point[] solve(int n, int m) {
        if (n == 0) {
            return new Point[]{
                    p(0, 1), p(0, m), p(0, 0), p(0, m - 1)
            };
        } else if (m == 0) {
            return new Point[]{
                    p(1, 0), p(n, 0), p(0, 0), p(n - 1, 0)
            };
        } else if (n > m) {
            return new Point[]{
                    p(0, 0), p(n, m), p(0, m), p(n, 0)
            };
        } else {
            return new Point[]{
                    p(0, 0), p(n, m), p(n, 0), p(0, m)
            };
        }
    }

    public static Point[] solve2(final int n, final int m) {
        if (n == 0) {
            return new Point[]{
                    p(0, 1), p(0, m), p(0, 0), p(0, m - 1)
            };
        } else if (m == 0) {
            return new Point[]{
                    p(1, 0), p(n, 0), p(0, 0), p(n - 1, 0)
            };
        }
        HashSet<Point> candS = new HashSet<Point>() {{
            add(p(0, 0));
            add(p(0, 1));
            add(p(1, 0));
            add(p(n, m));
            add(p(n - 1, m));
            add(p(n, m - 1));
            add(p(n, 0));
            add(p(n - 1, 0));
            add(p(n, 1));
            add(p(0, m));
            add(p(0, m - 1));
            add(p(1, m));
        }};
        ArrayList<Point> cand = new ArrayList<Point>(candS);
        Point[] best = null;
        for (int i = 0; i < cand.size(); i++) {
            for (int j = 0; j < cand.size(); j++) {
                for (int k = 0; k < cand.size(); k++) {
                    for (int k2 = 0; k2 < cand.size(); k2++) {
                        Point[] now = new Point[] {cand.get(i), cand.get(j), cand.get(k), cand.get(k2)};
                        if (noDuplicates(now)) {
                            if (best == null || compare(sum(best), sum(now)) < 0) {
                                best = now;
                            }
                        }
                    }
                }
            }
        }
        return best;
    }

    public static double sum(Point[] p) {
        double sum = 0;
        for (int i = 0; i < p.length - 1; i++) {
            sum += p[i].distTo(p[i + 1]);
        }
        return sum;
    }

    public static boolean noDuplicates(Point[] p) {
        HashSet<Point> hs = new HashSet<Point>(Arrays.asList(p));
        return hs.size() == p.length;
    }

    public static int compare(double a, double b) {
        if (Math.abs(a - b) < EPS) {
            return 0;
        }
        return a < b ? -1 : 1;
    }

    public static Point[] solveSlow(int n, int m) {
        Point[] best = null;
        for (int x1 = 0; x1 <= n; x1++) {
            for (int y1 = 0; y1 <= m; y1++) {
                for (int x2 = 0; x2 <= n; x2++) {
                    for (int y2 = 0; y2 <= m; y2++) {
                        for (int x3 = 0; x3 <= n; x3++) {
                            for (int y3 = 0; y3 <= m; y3++) {
                                for (int x4 = 0; x4 <= n; x4++) {
                                    for (int y4 = 0; y4 <= m; y4++) {
                                        Point[] now = new Point[] {p(x1, y1), p(x2, y2), p(x3, y3), p(x4, y4)};
                                        if (noDuplicates(now)) {
                                            if (best == null || compare(sum(best), sum(now)) < 0) {
                                                best = now;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return best;
    }

    void stress(int MAXSUM) {
        for (int sum = 0; sum < MAXSUM; sum++) {
            for (int n = 0; n <= sum; n++) {
                int m = sum - n;
                if ((n + 1) * (m + 1) < 4) {
                    continue;
                }
                System.err.println("checking " + n + " " + m);
                Point[] ans1 = solve2(n, m);
                Point[] ans2 = solveSlow(n, m);
                double sum1 = sum(ans1);
                double sum2 = sum(ans2);
                System.err.println("Fast: " + sum1 + " : " + Arrays.toString(ans1));
                System.err.println("Slow: " + sum2 + " : " + Arrays.toString(ans2));
                if (compare(sum1, sum2) != 0) {
                    throw new AssertionError();
                }
            }
        }
    }

    void solve() throws IOException {
//        stress(100);
        int n = in.nextInt();
        int m = in.nextInt();
        for (Point p : solve2(n, m)) {
            out.println(p.x + " " + p.y);
        }
    }

    static MyScanner in;
    static PrintWriter out;

    public static void main(String[] args) throws IOException {
        in = new MyScanner(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        new B().solve();
        out.close();
    }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner(Reader r) {
            br = new BufferedReader(r);
        }

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

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