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 Main{
    final boolean isFileIO = false; 
    BufferedReader in;
    PrintWriter out;
    StringTokenizer st = new StringTokenizer("");
    String delim = " ";

    public static void main(String[] args) throws IOException {
        Main m = new Main();
        m.initIO();
        m.solve();
        m.in.close();
        m.out.close();
    }

    public void initIO() throws IOException {
        if(!isFileIO) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt"); 
        }
    }
  
    String nextToken() throws IOException {
        if(!st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken(delim);
    }
 
    String readLine() throws IOException {
        return in.readLine();
    }

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

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

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
    
    class Point {
        public int x, y;
        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }

    
    int n, m;
    void solve() throws IOException {
        n = nextInt(); m = nextInt();
        double max = 0;
        Point[][] var = {
            {new Point(0, 0), new Point(n, m), new Point(0, m), new Point(n, 0)},
            {new Point(n, 0), new Point(0, m), new Point(0, 0), new Point(n, m)},
            {new Point(0, 1), new Point(n, m), new Point(0, 0), new Point(n, m - 1)},
            {new Point(1, 0), new Point(n, m), new Point(0, 0), new Point(n - 1, m)}
        };
        Point[] ans = null;
        for(int i = 0; i < 4; i++) {
            if(isOkay(var[i]) && !eq(var[i])) {
                if(max < sum(var[i])) {
                    max = sum(var[i]);
                    ans = var[i];
                }
            }
        }
        for(int i = 0; i < 4; i++)
            out.println(ans[i].x + " " + ans[i].y);
    }

    boolean isOkay(Point[] points) {
        for(int i = 0; i < 4; i++) {
            if(points[i].x < 0 || points[i]. y < 0 || points[i].x > n || points[i].y > m)
                return false;
        }
        return true;
    }

    boolean eq(Point[] points) {
        for(int i = 0; i < 4; i++)
            for(int j = i + 1; j < 4; j++)
                if(points[i].x == points[j].x && points[i].y == points[j].y)
                    return true;
        return false;
    }

    double sum(Point[] points) {
        double ans = 0;
        for(int i = 0; i < 3; i++)
            ans += dist(points[i], points[i + 1]);
        return ans;
    }

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

}