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.*;
import java.io.*;

public class Main implements Runnable {
	class Point{
            int x, y;
            Point(int x, int y){
                this.x = x;
                this.y = y;
            }
            
            int distance(Point b){
                return (x - b.x) * (x - b.x) + (y - b.y) * (y -b.y);
            }
            
            public int hashCode(){
                final int prime = 31;
                int result = 1;
                result  = result * prime + x;
                result = result * prime + y;
                
                return result;
            }
            
            public boolean equals(Object b){
                if(this == b) return true;
                if(b == null) return false;
                if(getClass() != b.getClass()) return false;
                Point p = (Point) b;
                if(x != p.x) return false;
                if(y != p.y) return false;
                
                return true;
            }
        }	
        
        public void add(int x, int y){
            if(x >= 0 && x <= N && y >= 0 && y <= M){
                pset.add(new Point(x, y));
            }
        }
        
        Set<Point> pset;
        int N, M;
	public void solve() throws IOException {
		pset = new HashSet<>();
                N = nextInt();
                M = nextInt();
                
                add(0, 0);
                add(0, M);
                add(N, 0);
                add(N, M);
                
                add(1, 0);
                add(N-1, 0);
                add(1, M);
                add(N-1, M);
                
                add(0, 1);
                add(0, M-1);
                add(N, 1);
                add(N, M-1);
                
                add(1, 1);
                add(N-1, M-1);
                add(N-1, 1);
                add(1, M-1);
                
                Point[] ap = new Point[pset.size()];
                int index = 0;
                for(Point ps : pset) ap[index++] = ps;
                
                int best = 0;
                Point[] ans = new Point[4];
                
                for(int i = 0; i < ap.length; i++){
                    for(int j = 0; j < ap.length; j++){
                        if(i != j){
                            for(int k = 0; k < ap.length; k++){
                                if(k != i && k != j){
                                    for(int l = 0; l < ap.length; l++){
                                        if(l != i && l != j && l != k){
                                            int distance = ap[i].distance(ap[j]) + ap[j].distance(ap[k]) + ap[k].distance(ap[l]);
                                            if(distance > best){
                                                best = distance;
                                                ans[0] = ap[i];
                                                ans[1] = ap[j];
                                                ans[2] = ap[k];
                                                ans[3] = ap[l];
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                    
                
                for(Point a : ans){
                    System.out.println(a.x + " " + a.y);
                }
                
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	//-----------------------------------------------------------
	public static void main(String[] args) {
		new Main().run();
	}

        public void print1Int(int[] a){
                for(int i = 0; i < a.length; i++)
                        System.out.print(a[i] + " ");
                System.out.println();
        }
        
        public void print2Int(int[][] a){
                for(int i = 0; i < a.length; i++){
                        for(int j = 0; j < a[0].length; j++){
                                System.out.print(a[i][j] + " ");
                        }
                        System.out.println();
                }
        }
        
	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			tok = null;
			solve();
			in.close();
		} catch (IOException e) {
			System.exit(0);
		}
	}

	public String nextToken() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

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

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

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	BufferedReader in;
	StringTokenizer tok;
}