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

public class Task {

    public void solve() throws IOException {
        int n = in.nextInt();
        int m = in.nextInt();
        Point[] a = new Point[100];
        int size = 0;
        int count = (n + 1) * (m + 1);
        if (count < 50) {
            for (int i = 0; i <= n; ++i) {
                for (int j = 0; j <= m; ++j) {
                    a[size++] = new Point(i, j);
                }
            }
        } else if (n <= 6) {
            for (int i = 0; i <= n; ++i) {
                for (int j = 0; j <= 6; ++j) {
                    a[size++] = new Point(i, j);
                    if (j < n - j) a[size++] = new Point(i, m - j);
                }
            }
        } else if (m <= 6) {
            for (int i = 0; i <= m; ++i) {
                for (int j = 0; j <= 6; ++j) {
                    a[size++] = new Point(j, i);
                    if (i < n - i) a[size++] = new Point(n - j, i);
                }
            }
        } else {
            for (int i = 0; i <= 3; ++i) {
                for (int j = 0; j <= 3; ++j) {
                    a[size++] = new Point(i, j);
                    a[size++] = new Point(i, m - j);
                    a[size++] = new Point(n - i, m - j);
                    a[size++] = new Point(n - i, j);
                }
            }
        }
        double[][] d = new double[size][size];
        for (int i = 0; i < size; ++i) {
            for (int j = 0; j < size; ++j) {
                d[i][j] = a[i].dist(a[j]);
            }
        }
        int[] ans = new int[0];
        double sum = 0;
        boolean[] used = new boolean[size];
        for (int i = 0; i < size; ++i) {
            used[i] = true;
            for (int j = 0; j < size; ++j) {
                if (used[j]) continue;
                used[j] = true;
                for (int k = 0; k < size; ++k) {
                    if (used[k]) continue;
                    used[k] = true;
                    for (int l = 0; l < size; ++l) {
                        if (used[l]) continue;
                        double now = d[i][j] + d[j][k] + d[k][l];
                        if (now > sum) {
                            sum = now;
                            ans = new int[]{i, j, k, l};
                        }
                    }
                    used[k] = false;
                }
                used[j] = false;
            }
            used[i] = false;
        }
        for (int i : ans) {
            out.println(a[i].x + " " + a[i].y);
        }
    }

    static FastReader in;
    static PrintWriter out;
    static PrintStream err;

    public static void main(String[] args) throws IOException {
        try {
            in = new FastReader();
            out = new PrintWriter(System.out);
            err = System.err;
            new Task().solve();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
}

class FastReader {
    BufferedReader br;
    StringTokenizer in;

    FastReader() {
        this.br = new BufferedReader(new InputStreamReader(System.in));
    }

    FastReader(String filename) {
        try {
            this.br = new BufferedReader(new FileReader(filename));
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    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 nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
}

class Point {
    int x;
    int y;

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

    public long mulv(Point a) {
        return (long) this.x * a.y - (long) this.y * a.x;
    }

    public long len2() {
        return (long) this.x * this.x + (long) this.y * this.y;
    }

    public double len() {
        return Math.sqrt(this.len2());
    }

    public double dist2(Point a) {
        return (this.x - a.x) * (this.x - a.x) + (this.y - a.y) * (this.y - a.y);
    }

    public double dist(Point a) {
        return Math.sqrt((this.x - a.x) * (this.x - a.x) + (this.y - a.y) * (this.y - a.y));
    }

    public Point sub(Point a) {
        return new Point(this.x - a.x, this.y - a.y);
    }

    public Point add(Point a) {
        return new Point(this.x + a.x, this.y + a.y);
    }

    public static Point[] convexHull(Point[] a) {
        int n = a.length;
        int mn = 0;
        for (int i = 1; i < n; ++i) {
            if (a[i].x < a[mn].x || (a[i].x == a[mn].x && a[i].y < a[mn].y)) {
                mn = i;
            }
        }
        Point start = a[mn];
        a[mn] = a[0];
        a[0] = start;
        for (int i = 1; i < n; ++i) {
            a[i] = a[i].sub(start);
        }
        Arrays.sort(a, 1, a.length, new Comparator<Point>() {
            @Override
            public int compare(Point o1, Point o2) {
                long m = o1.mulv(o2);
                if (m != 0) {
                    return -Long.signum(m);
                }
                return Long.signum(o1.len2() - o2.len2());
            }
        });
        for (int i = 1; i < n; ++i) {
            a[i] = a[i].add(start);
        }
        Point[] h = new Point[n];
        int size = 0;
        for (Point p : a) {
            while (size > 1 && h[size - 1].sub(h[size - 2]).mulv(p.sub(h[size - 2])) <= 0) {
                --size;
            }
            h[size++] = p;
        }
        return Arrays.copyOf(h, size);
    }

    public static double perimeter(Point[] a) {
        double ret = 0;
        for (int i = 0; i < a.length; ++i) {
            ret += a[i].dist(a[(i + 1) % a.length]);
        }
        return ret;
    }
}