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.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;


public class B {

    static StringTokenizer st;
    static BufferedReader br;
    static PrintWriter pw;
    static int x1, y1, x2, y2, x3, y3, x4, y4, n, m;
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        n = nextInt();
        m = nextInt();
        double d1 = 0, d2 = 0;
        if (n > 0) {
            d1 = calc(1, 0);
        }
        if (m > 0) {
            d2 = calc(0, 1);
        }
        double d3 = calc(0, 0);
        if (d1+1e-8 > d2 && d1+1e-8 > d3) {
            calc(1, 0);
        }
        else if (d2+1e-8 > d1 && d2+1e-8 > d3)
            calc(0, 1);
        else
            calc(0, 0);
        System.out.println(x1+" "+y1);
        System.out.println(x2+" "+y2);
        System.out.println(x3+" "+y3);
        System.out.println(x4+" "+y4);
        //System.out.println(0+" "+0);
//      System.out.println(n+" "+m);
//      if (n==0) {
//          System.out.println(0+" "+1);
//          System.out.println(0+" "+(m-1));
//          return;
//      }
//      System.out.println(0+" "+0);
//      System.out.println(n+" "+m);
//      double max = 0;
//      int xx1 = 0, yy1 = 0, xx2 = 0, yy2 = 0, xx3 = 0, yy3 = 0, xx4 = 9, yy4 = 0;
//      for (int x1 = 0; x1 <= n; x1++) {
//          for (int y1 = 0; y1 <= m; y1++) {
//              for (int x2 = 0; x2 <= n; x2++) {
//                  for (int y2 = 0; y2 <= m; y2++) {
//                      if (x2==x1 && y2==y1)
//                          continue;
//                      for (int x3 = 0; x3 <= n; x3++) {
//                          for (int y3 = 0; y3 <= m; y3++) {
//                              if (x3==x1 && y3==y1 || x3==x2 && y3==y2)
//                                  continue;
//                              for (int x4 = 0; x4 <= n; x4++) {
//                                  for (int y4 = 0; y4 <= m; y4++) {
//                                      if (x4==x1 && y4==y1 || x4==x2 && y4==y2 || x4==x3 && y4==y3)
//                                          continue;
//                                      double d = dis(x1, y1, x2, y2)+dis(x2, y2, x3, y3)+dis(x3, y3, x4, y4);
//                                      if (d > max) {
//                                          max = d;
//                                          xx1 = x1;
//                                          yy1 = y1;
//                                          xx2 = x2;
//                                          yy2 = y2;
//                                          xx3 = x3;
//                                          yy3 = y3;
//                                          xx4 = x4;
//                                          yy4 = y4;
//                                      }
//                                  }
//                              }
//                          }
//                      }
////                        if (x1==0 && y1==0 || x2==n && y2==m)
////                            continue;
////                        if (dis(n, m, x1, y1)+dis(x1, y1, x2, y2) > max) {
////                            max = dis(n, m, x1, y1)+dis(x1, y1, x2, y2);
////                            xx1 = x1;
////                            yy1 = y1;
////                            xx2 = x2;
////                            yy2 = y2;
////                        }
//                  }
//              }
//          }
//      }
//      System.out.println(xx1+" "+yy1+" "+xx2+" "+yy2+" "+xx3+" "+yy3+" "+xx4+" "+yy4);
//      System.out.println(max);
        pw.close();
    }
    private static double calc(int x, int y) {
        x1 = x;
        y1 = y;
        x2 = n;
        y2 = m;
        int[]xx = new int[(int) (1e6+1)], yy = new int[(int) (1e6+1)];
        int cnt = 0;
        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= m; j++) {
                if (i==x1 && j==y1 || i==x2 && j==y2)
                    continue;
                if (i==0 || i==n || j==0 || j==m) {
                    cnt++;
                    xx[cnt] = i;
                    yy[cnt] = j;
                }
            }
        }
        double max = 0;
        for (int i = 1; i <= cnt; i++) {
            if (xx[i]==x1 && yy[i]==y1 || xx[i]==x2 && yy[i]==y2)
                continue;
            for (int j = 1; j <= cnt; j++) {
                if (xx[i]==xx[j] && yy[i]==yy[j])
                    continue;
                if (xx[j]==x1 && yy[j]==y1 || xx[j]==x2 && yy[j]==y2)
                    continue;
                double d = dis(x2, y2, xx[i], yy[i])+dis(xx[i], yy[i], xx[j], yy[j]); 
                if (d > max) {
                    max = d;
                    x3 = xx[i];
                    y3 = yy[i];
                    x4 = xx[j];
                    y4 = yy[j];
                }
            }
        }
        return dis(x1, y1, x2, y2)+max;
    }
    private static double dis(int x1, int y1, int x2, int y2) {
        return Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
    }
    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
    private static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
    private static String next() throws IOException {
        while (st==null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
}