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:
/*
 *
 * @author Mukesh Singh
 *
 */

import java.io.*;
import java.util.*;
import java.text.DecimalFormat;
@SuppressWarnings("unchecked")
public class AB {	
	//solve test cases
	void solve() throws Exception {
		int n = in.nextInt();
		int m = in.nextInt();
		if(n == 0 ){
			System.out.println(0+" "+1);
			System.out.println(0+" "+(m));
			System.out.println(0+" "+0);
			System.out.println(0+" "+(m-1));
		}else if(m==0){
			System.out.println(1+" "+0);
			System.out.println((n)+" "+0);
			System.out.println(0+" "+0);
			System.out.println((n-1)+" "+0);
		}else{
			TreeSet<Point> ts = new TreeSet<Point>(new Comparator<Point>(){
				public int compare(Point p1 , Point p2){
					if(p1.x == p2.x && p2.y == p1.y) return 0 ;
					if(p1.x< p2.x) return -1 ;
					else if(p1.x == p2.x && p1.y < p2.y)  return -1;
					else return 1 ;
				}
			});
			ts.add(new Point(0,0));
			ts.add(new Point(0,1));
			ts.add(new Point(1,0));
			ts.add(new Point(n-1,0));
			ts.add(new Point(n,0));
			ts.add(new Point(n,1));
			ts.add(new Point(0,m-1));
			ts.add(new Point(0,m));
			ts.add(new Point(1,m));
			ts.add(new Point(n,m));
			ts.add(new Point(n-1,m));
			ts.add(new Point(n,m-1));
			Point[]  p = new Point[ts.size()];
			int idx= 0 ; 
			for(Point pp : ts) p[idx++] = pp ;
			dis = 0 ;
			res1 = res2=res3=res0 = null ;
			n = ts.size();
			for(int i = 0 ; i < n ; ++i ){
				for(int j = i+1 ; j < n ; ++j ){
					for(int k = j+1 ; k < n ; ++k ){
						for(int l = k+1; l < n ; ++l ){
							Point[] ar = new Point[4]; 
							ar[0] = p[i] ;ar[1] = p[j] ;ar[2] = p[k] ;ar[3] = p[l] ;
							int[] perm = new int[4]; perm[0] = 0 ; 
							perm[1] = 1 ; perm[2]= 2 ; perm[3] =3 ;
							f(0,3 , perm, ar);
						}
					}
				}
			}
			System.out.println(res0.x+" "+res0.y);	
			System.out.println(res1.x+" "+res1.y);	
			System.out.println(res2.x+" "+res2.y);	
			System.out.println(res3.x+" "+res3.y);	
		}			
	}
	void f(int start , int end , int[] perm , Point[] p){
		if(start == end){
			double d = dist(p[perm[0]],p[perm[1]]);
			d += dist(p[perm[1]],p[perm[2]]);
			d += dist(p[perm[2]],p[perm[3]]);
			if(dis < d ){
				dis = d ; res0 = p[perm[0]]; res1 = p[perm[1]];res2 = p[perm[2]];res3 = p[perm[3]];
			}
		}else{
			for(int i = start ; i <= end ; ++i ){
				int t = perm[start] ; perm[start] = perm[i] ; perm[i] = t ;
				f(start+1 , end , perm , p ); 
				t = perm[start] ; perm[start] = perm[i] ; perm[i] = t ;
			}
		}
	}
	double dis  ; Point res1, res2,res3,res0 ;
	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));
		}
	class Point{
		int x , y ;
		Point(int a , int b){
			x = a ; y = b ;
		}
	}
	//@ main function
	public static void main(String[] args) throws Exception {
		new AB();
	}
	
	InputReader in;
	PrintStream out ;
	DecimalFormat df ;
	AB() {
		try {
			File defaultInput = new File("file.in");
			if (defaultInput.exists()) 
				in = new InputReader("file.in");
			else 
				in = new InputReader();
			defaultInput = new File("file.out");
			if (defaultInput.exists()) 
				out = new PrintStream(new FileOutputStream("file.out"));
			else
				out = new PrintStream(System.out);
			df = new DecimalFormat("######0.00");
			solve();
			out.close();
		} 
		catch (Exception e) {
			e.printStackTrace();
			System.exit(261);
		}
	}
	
	class InputReader {
		BufferedReader reader;
		StringTokenizer tokenizer;
		
		InputReader() {
			reader = new BufferedReader(new InputStreamReader(System.in));
		}
		
		InputReader(String fileName) throws FileNotFoundException {
			reader = new BufferedReader(new FileReader(new File(fileName)));
		}
		
		String readLine() throws IOException {
			return reader.readLine();
		}
		
		String nextToken() throws IOException {
			while (tokenizer == null || !tokenizer.hasMoreTokens())
				tokenizer = new StringTokenizer(readLine());
			return tokenizer.nextToken();
		}
		
		boolean hasMoreTokens() throws IOException {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				String s = readLine();
				if (s == null)
					return false;
				tokenizer = new StringTokenizer(s);
			}
			return true;
		}
		
		int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(nextToken());
		}
		
		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(nextToken());
		}
		
		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(nextToken());
		}
	}
}