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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Main {

    /**
     * @param args
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc = new Scanner(br.readLine());
        int x = sc.nextInt();
        int y = sc.nextInt();
        Set<Point> points = new HashSet<Point>();
        for (int i = 0; i <= x && i <= 2; i++) {
            for (int j = 0; j <= y && j <= 2; j++) {
                points.add(new Point(i, j));
            }
        }
        for (int i = x; i >= 0 && i >= x - 2; i--) {
            for (int j = 0; j <= y && j <= 2; j++) {
                points.add(new Point(i, j));
            }
        }
        for (int i = 0; i <= x && i <= 2; i++) {
            for (int j = y; j >= 0 && j >= y - 2; j--) {
                points.add(new Point(i, j));
            }
        }
        for (int i = x; i >= 0 && i >= x - 2; i--) {
            for (int j = y; j >= 0 && j >= y - 2; j--) {
                points.add(new Point(i, j));
            }
        }
        double max = 0;
        Point Output1 = new Point();
        Point Output2 = new Point();
        Point Output3 = new Point();
        Point Output4 = new Point();
        Point[] arr = new Point[points.size()];
        points.toArray(arr);
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr.length; j++) {
                if (i == j)
                    continue;
                for (int k = 0; k < arr.length; k++) {
                    if (i == k || j == k)
                        continue;
                    for (int l = 0; l < arr.length; l++) {
                        if (i == l || j == l || k == l)
                            continue;
                        Point p1 = arr[i];
                        Point p2 = arr[j];
                        Point p3 = arr[k];
                        Point p4 = arr[l];
                        double diffP1P2X = p1.getX() - p2.getX();
                        double diffP1P2Y = p1.getY() - p2.getY();
                        double diffP2P3X = p2.getX() - p3.getX();
                        double diffP2P3Y = p2.getY() - p3.getY();
                        double diffP3P4X = p3.getX() - p4.getX();
                        double diffP3P4Y = p3.getY() - p4.getY();
                        double currentLength = Math.sqrt(diffP1P2X * diffP1P2X
                                + diffP1P2Y * diffP1P2Y);
                        currentLength = currentLength
                                + Math.sqrt(diffP2P3X * diffP2P3X + diffP2P3Y
                                        * diffP2P3Y);
                        currentLength = currentLength
                                + Math.sqrt(diffP3P4X * diffP3P4X + diffP3P4Y
                                        * diffP3P4Y);
                        if (max < currentLength) {
                            max = currentLength;
                            Output1.setX(p1.x);
                            Output1.setY(p1.y);
                            Output2.setX(p2.x);
                            Output2.setY(p2.y);
                            Output3.setX(p3.x);
                            Output3.setY(p3.y);
                            Output4.setX(p4.x);
                            Output4.setY(p4.y);
                        }
                    }
                }
            }
        }
        System.out.println(Output1);
        System.out.println(Output2);
        System.out.println(Output3);
        System.out.println(Output4);
    }
}

class Point {
    int x;

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

    public double getX() {
        return x * 1.0;
    }

    public void setX(int x) {
        this.x = x;
    }

    public double getY() {
        return y * 1.0;
    }

    public void setY(int y) {
        this.y = y;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Point other = (Point) obj;
        if (x != other.x)
            return false;
        if (y != other.y)
            return false;
        return true;
    }

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

    public Point() {
        // TODO Auto-generated constructor stub
    }

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

    int y;
}