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.math.BigInteger;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class B implements Runnable {

    // leave empty to read from stdin/stdout
    private static final String TASK_NAME_FOR_IO = "";

    // file names
    private static final String FILE_IN = TASK_NAME_FOR_IO + ".in";
    private static final String FILE_OUT = TASK_NAME_FOR_IO + ".out";

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tokenizer = new StringTokenizer("");

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

    int d = 3;
    int n, m;

    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 = 1013 * result + y;
            return result;
        }

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

    }

    Set<Point> set = new HashSet<Point>();

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

        put(0, 0);
        put(n, 0);
        put(0, m);
        put(n, m);

        double maxDist = -1;
        Point _p1 = null, _p2 = null, _p3 = null, _p4 = null;
        for (Point p1 : set)
            for (Point p2 : set)
                if (!p2.equals(p1))
                    for (Point p3 : set)
                        if (!p3.equals(p1) && !p3.equals(p2))
                            for (Point p4 : set)
                                if (!p4.equals(p1) && !p4.equals(p2) && !p4.equals(p3)) {
                                    double dist = p1.distTo(p2) + p2.distTo(p3) + p3.distTo(p4);
                                    if (dist > maxDist) {
                                        maxDist = dist;
                                        _p1 = p1;
                                        _p2 = p2;
                                        _p3 = p3;
                                        _p4 = p4;
                                    }
                                }

        out.println(_p1.x + " " + _p1.y);
        out.println(_p2.x + " " + _p2.y);
        out.println(_p3.x + " " + _p3.y);
        out.println(_p4.x + " " + _p4.y);
    }

    private void put(int x, int y) {
        for (int dx = -d; dx <= d; dx++)
            for (int dy = -d; dy <= d; dy++)
                if ((0 <= x + dx) && (x + dx <= n) && (0 <= y + dy) && (y + dy <= m)) {
                    set.add(new Point(x + dx, y + dy));
                }
    }

    public void run() {
        long timeStart = System.currentTimeMillis();

        boolean fileIO = TASK_NAME_FOR_IO.length() > 0;
        try {

            if (fileIO) {
                in = new BufferedReader(new FileReader(FILE_IN));
                out = new PrintWriter(new FileWriter(FILE_OUT));
            } else {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(new OutputStreamWriter(System.out));
            }

            solve();

            in.close();
            out.close();
        } catch (IOException e) {
            throw new IllegalStateException(e);
        }
        long timeEnd = System.currentTimeMillis();

        if (fileIO) {
            System.out.println("Time spent: " + (timeEnd - timeStart) + " ms");
        }
    }

    private String nextToken() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null) {
                return null;
            }
            tokenizer = new StringTokenizer(line);
        }
        return tokenizer.nextToken();
    }

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

    private BigInteger nextBigInt() throws IOException {
        return new BigInteger(nextToken());
    }

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

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

}