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.Arrays;
import java.util.HashSet;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.PrintStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskB {
    public void solve(int testNumber, FastScanner in, PrintWriter out) {
        int m = in.nextInt();
        int n = in.nextInt();
        int x[] = {m, m - 1, m, 0, 0, 1, m -1 , 1,0, m};
        int y[] = {n, n , n - 1, 0, 1, 0, n - 1, 1, n, 0};
        long max = 0;
        int ax[] = {};
        int ay[] = {};
        out:for (int i = 0;i <= (1 << x.length);i++) {
            if(Integer.bitCount(i) == 4) {
                int p[] = {0, 1, 2, 3};
                int x1[] = new int[4];
                int y1[] = new int[4];
                int xi = 0;
                for (int j = 0;j < x.length;j++) {
                    if ((i & (1 << j)) != 0) {
                        x1[xi] = x[j];
                        y1[xi++] = y[j];

                    }
                }
                //System.out.println("xi" + xi + "," + Integer.toBinaryString(i));
                HashSet<Point> hs = new HashSet<Point>();
                for (int j = 0;j < x1.length;j++) {
                    hs.add(new Point(x1[j], y1[j]));
                    if(x1[j] >= 0 && x1[j] <= m && y1[j] >= 0 && y1[j] <= n) continue;
                    else continue out;
                }
                if(hs.size() != 4) {
                    continue out;
                }
                do {
                    int ax1[] = {x1[p[0]], x1[p[1]],  x1[p[2]],  x1[p[3]]};
                    int ay1[] = {y1[p[0]], y1[p[1]],  y1[p[2]],  y1[p[3]]};
                    if(max < dist(x1[p[0]], y1[p[0]], x1[p[1]], y1[p[1]], x1[p[2]], y1[p[2]], x1[p[3]], y1[p[3]])) {
                        max = dist(x1[p[0]], y1[p[0]], x1[p[1]], y1[p[1]], x1[p[2]], y1[p[2]], x1[p[3]], y1[p[3]]);
                        ax = Arrays.copyOf(ax1, ax1.length);
                        ay = Arrays.copyOf(ay1, ay1.length);
                    }
                }while (MathUtils.nextPerm(p));
            }
        }
       // out.println(max + "," +  dist(0, 1, 0, 10, 0, 0, 0, 9));
        for (int i = 0;i < 4;i++) {
            out.println(ax[i] + " " + ay[i]);
        }


    }

    public long dist(int m, int n, int a, int b, int p, int q, int x, int y) {
        long v = dist(m,n,a,b) + dist(a,b,p,q) + dist(p, q, x, y);
        return v;
    }

    public long dist(long m, long n, long p, long q) {
        return ((m - p) * (m - p)) + ((n - q) * (n - q));
    }

    class Point {
        int x,y;
        Point(int x, int y) {
            this.x = x;
            this.y = y;
        }
        public int hashCode() {
            return Arrays.hashCode(new int[]{x, y});
        }
        public boolean equals(Object o) {
            Point p = (Point)(o);
            return this.x == p.x && p.y == this.y;
        }

    }
}

class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    public FastScanner(InputStream in) {
        try {
            br = new BufferedReader(new InputStreamReader(in));
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }


    public String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                //ignored
            }
        }
        return st.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}

class MathUtils {


    public static boolean nextPerm(int a[]){
        int si=-1;
        int ei=-1;
        //find largest index
        for(int i=a.length-2;i>=0;i--){
            if(a[i]<a[i+1]){
                si=i;
                break;
            }
        }
        if(si==-1)return false;
        for(int i=a.length-1;i>=si+1;i--){
            if(a[i]>a[si]){
               ei=i;
               break;
            }
        }
        int t=a[si];
        a[si]=a[ei];
        a[ei]=t;
        //swap all element after si(reverse)
        for(int i=0;i<=(a.length-si-2)/2;i++){
            t=a[si+i+1];
            a[si+i+1]=a[a.length-1-i];
            a[a.length-1-i]=t;
        }
        return true;
    }


}