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.Set;

public class Polyline {
    private Polyline() throws IOException {
        BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
        String h = rd.readLine();
        String[] q = h.split("\\s+");
        int n = Integer.parseInt(q[0]);
        int m = Integer.parseInt(q[1]);
        Set<String> pts1 = new HashSet<String>();
        Set<String> pts2 = new HashSet<String>();
        for(int i=-2;i<3;i++) {
            for(int j=-2;j<3;j++) {
                if(i==0 || j==0) {
                    int x = i;
                    int y = j;
                    if(x >= 0 && x <= n && y >= 0 && y <= m) {
                        pts1.add(x+"_"+y);
                    }
                }
            }
        }

        for(int i=-2;i<3;i++) {
            for(int j=-2;j<3;j++) {
                if(i==0 || j==0) {
                    int x = n+i;
                    int y = m+j;
                    if(x >= 0 && x <= n && y >= 0 && y <= m) {
                        pts2.add(x+"_"+y);
                    }
                }
            }
        }

        List<int[]> pts1x = new ArrayList<int[]>();
        for(String s: pts1) {
            pts1x.add(parse(s));
        }

        List<int[]> pts2x = new ArrayList<int[]>();
        for(String s: pts2) {
            pts2x.add(parse(s));
        }

        int[][] res = new int[4][2];
        double mx = 0;
        for(int[] p1: pts1x) {
            for(int[] p2: pts2x) {
                if(diff(p1,p2)) {
                    for(int[] p3: pts1x) {
                        if(diff(p3,p2) && diff(p3,p1)) {
                            for(int[] p4: pts2x) {
                                if(diff(p4,p3) && diff(p4,p2) && diff(p4,p1)) {
                                    double d = 0;
                                    d += len(p1,p2) + len(p2,p3) + len(p3,p4);
                                    if(d > mx) {
                                        mx = d;
                                        res[0] = p1;
                                        res[1] = p2;
                                        res[2] = p3;
                                        res[3] = p4;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        double d2 = Math.sqrt(m*m+n*n)*2 + Math.max(m,n);
        if(d2 > mx && m > 0 && n > 0) {
            if(m > n) {
                out("0 0");
                out(n+" "+m);
                out(n+" 0");
                out("0 "+m);
            } else {
                out("0 0");
                out(n+" "+m);
                out("0 "+m);
                out(n+" 0");
            }
        } else {
            for(int i=0;i<4;i++) {
                out(res[i][0]+" "+res[i][1]);
            }
        }
    }

    private boolean diff(int[] a, int[] b) {
        return a[0] != b[0] || a[1] != b[1];
    }

    private double len(int[] a, int[] b) {
        int xdiff = a[0] - b[0];
        int ydiff = a[1] - b[1];
        return Math.sqrt(xdiff*xdiff + ydiff*ydiff);
    }

    private int[] parse(String s) {
        String[] h = s.split("_");
        return new int[] { Integer.parseInt(h[0]), Integer.parseInt(h[1]) };
    }

    private static void out(Object x) {
        System.out.println(x);
    }

    public static void main(String[] args) throws IOException {
        new Polyline();
    }
}