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.List;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Tifuera
 */
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 {
    List<Point> points;
    int n;
    int m;
    double res = -1;
    int[] xP = new int[4];
    int[] yP = new int[4];
    boolean[] used;

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

        points = new ArrayList<>();
        addIfCan(0, 0);
        addIfCan(0, 1);
        addIfCan(1, 0);
        addIfCan(1, 1);

        addIfCan(n, 0);
        addIfCan(n - 1, 0);
        addIfCan(n, 1);
        addIfCan(n - 1, 1);

        addIfCan(0, m);
        addIfCan(0, m-1);
        addIfCan(1, m);
        addIfCan(1, m - 1);

        addIfCan(n, m);
        addIfCan(n - 1, m);
        addIfCan(n, m - 1);
        addIfCan(n - 1, m - 1);

        used = new boolean[points.size()];
        calc(0, new ArrayList<Point>());

//        String strRes = String.format(Locale.US, "%.7f", res);
//        out.println(strRes);
        for (int i = 0; i < 4; i++) {
            out.println(xP[i] + " " + yP[i]);
        }
    }

    private void calc(int lvl, List<Point> curPoints) {
        if (lvl < 4) {
            for (int i = 0; i < points.size(); i++) {
                if (!used[i]) {
                    curPoints.add(points.get(i));
                    used[i] = true;
                    calc(lvl + 1, curPoints);
                    used[i] = false;
                    curPoints.remove(lvl);
                }
            }
        } else {
            double curRes = calcDist(curPoints.get(0), curPoints.get(1));
            curRes += calcDist(curPoints.get(1), curPoints.get(2));
            curRes += calcDist(curPoints.get(2), curPoints.get(3));
            if (curRes > res) {
                res = curRes;
                xP[0] = curPoints.get(0).x;
                xP[1] = curPoints.get(1).x;
                xP[2] = curPoints.get(2).x;
                xP[3] = curPoints.get(3).x;

                yP[0] = curPoints.get(0).y;
                yP[1] = curPoints.get(1).y;
                yP[2] = curPoints.get(2).y;
                yP[3] = curPoints.get(3).y;
            }

        }

    }

    private double calcDist(Point p1, Point p2) {
        return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
    }

    private void addIfCan(int x, int y) {
        if (x >= 0 && y >= 0) {
            if (x <= n && y <= m) {
                Point cur = new Point(x, y);
                if (!points.contains(cur)) {
                    points.add(cur);
                }
            }
        }
    }


    private static class Point {
        int x;
        int y;

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

        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;
        }

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

}

class InputReader {
    private BufferedReader reader;
    private String[] currentArray;
    private int curPointer;

    public InputReader(InputStream inputStream) {
        reader = new BufferedReader(new InputStreamReader(inputStream));
    }


    public int nextInt() {
        if ((currentArray == null) || (curPointer >= currentArray.length)) {
            try {
                currentArray = reader.readLine().split(" ");
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            curPointer = 0;
        }
        return Integer.parseInt(currentArray[curPointer++]);
    }

}