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.*;
import java.math.BigInteger;
import java.util.*;


public class B
{
        String line;
        StringTokenizer inputParser;
        BufferedReader is;
        FileInputStream fstream;
        DataInputStream in;
        String FInput="";
        
        void openInput(String file)
        {

                if(file==null)is = new BufferedReader(new InputStreamReader(System.in));//stdin
                else
                {
                        try{
                
                                
                        fstream = new FileInputStream(file);
                        in = new DataInputStream(fstream);
                        is = new BufferedReader(new InputStreamReader(in));
                        }catch(Exception e)
                        {
                                System.err.println(e);
                        }
                }

        }
        
        void readNextLine()
    	{
    		try {
    			line = is.readLine();
    			inputParser = new StringTokenizer(line, " ,\t");
    			//System.err.println("Input: " + line);
    		} catch (IOException e) {
    			System.err.println("Unexpected IO ERROR: " + e);
    		}	
    		catch (NullPointerException e)
    		{
    			line=null;
    			
    		}
    		
    	}
        
        long NextLong()
        {
                String n = inputParser.nextToken();
                
                long val = Long.parseLong(n);
                
                 return val;
        }
        
        int NextInt()
        {
                String n = inputParser.nextToken();
                int val = Integer.parseInt(n);
                
                //System.out.println("I read this number: " + val);
                return val;
        }
        
        String NextString()
        {
                String n = inputParser.nextToken();
                return n;
        }
        
        void closeInput()
        {
                try {
                        is.close();
                } catch (IOException e) {
                        System.err.println("Unexpected IO ERROR: " + e);
                }
                        
        }
        
        public static void main(String [] argv)
        {
                //String filePath="circles.in";
                String filePath=null;
                if(argv.length>0)filePath=argv[0];
                new B(filePath);
                
        }
        
        public B(String inputFile)
        {
        	openInput(inputFile);
    		StringBuilder sb = new StringBuilder();
    		readNextLine();
    		int N=NextInt();
    		int M = NextInt();
    		if(N==0)
    		{
    			sb.append("0 1\n");
    			sb.append("0 "+M+"\n");
    			sb.append("0 0\n");
    			sb.append("0 "+(M-1)+"\n");
    		}
    		else if (M==0)
    		{
    			sb.append("1 0\n");
    			sb.append(N+" 0\n");
    			sb.append("0 0\n");
    			sb.append((N-1)+" 0\n");
    		}
    		else
    		{
    			double best = 0;
    			
    			int [] x = {0, N, N, 0};
    			int [] y = {0, M, 0, M};
    			
    			double ret = getRet(x, y);
    			
    			if(ret>best)
    			{
    				sb = new StringBuilder();
    				sb.append(x[0]+" "+y[0]+"\n");
        			sb.append(x[1]+" "+y[1]+"\n");
        			sb.append(x[2]+" "+y[2]+"\n");
        			sb.append(x[3]+" "+y[3]+"\n");
        			best = ret;
    			}
    			
    			x = new int []{0, N, 0, N};
    			y = new int []{0, M, M, 0};
    			
    			ret = getRet(x, y);
    			if(ret>best)
    			{
    				sb = new StringBuilder();
    				sb.append(x[0]+" "+y[0]+"\n");
        			sb.append(x[1]+" "+y[1]+"\n");
        			sb.append(x[2]+" "+y[2]+"\n");
        			sb.append(x[3]+" "+y[3]+"\n");
        			best = ret;
    			}
    			
    			x = new int []{0, N, 1, N-1};
    			y = new int []{0, M, 0, M};
    			
    			ret = getRet(x, y);
    			if(ret>best)
    			{
    				sb = new StringBuilder();
    				sb.append(x[0]+" "+y[0]+"\n");
        			sb.append(x[1]+" "+y[1]+"\n");
        			sb.append(x[2]+" "+y[2]+"\n");
        			sb.append(x[3]+" "+y[3]+"\n");
        			best = ret;
    			}
    			
    			x = new int []{0, N, 0, N};
    			y = new int []{0, M, 1, M-1};
    			
    			ret = getRet(x, y);
    			if(ret>best)
    			{
    				sb = new StringBuilder();
    				sb.append(x[0]+" "+y[0]+"\n");
        			sb.append(x[1]+" "+y[1]+"\n");
        			sb.append(x[2]+" "+y[2]+"\n");
        			sb.append(x[3]+" "+y[3]+"\n");
        			best = ret;
    			}
    			
    			x = new int []{1, N, 0, N-1};
    			y = new int []{0, M, 0, M};
    			
    			ret = getRet(x, y);
    			if(ret>best)
    			{
    				sb = new StringBuilder();
    				sb.append(x[0]+" "+y[0]+"\n");
        			sb.append(x[1]+" "+y[1]+"\n");
        			sb.append(x[2]+" "+y[2]+"\n");
        			sb.append(x[3]+" "+y[3]+"\n");
        			best = ret;
    			}
    			
    			x = new int []{0, N, 0, N};
    			y = new int []{1, M, 0, M-1};
    			
    			ret = getRet(x, y);
    			if(ret>best)
    			{
    				sb = new StringBuilder();
    				sb.append(x[0]+" "+y[0]+"\n");
        			sb.append(x[1]+" "+y[1]+"\n");
        			sb.append(x[2]+" "+y[2]+"\n");
        			sb.append(x[3]+" "+y[3]+"\n");
        			best = ret;
    			}
    			
    			Random rgen = new Random();
    			for(int i=0; i<100000; i++)
    			{
    				for(int j=0; j<4; j++)
    				{
	    				if(rgen.nextBoolean())
	    				{
	    					if(rgen.nextBoolean())
	    						x[j]=0;
	    					else
	    						x[j]=N;
	    				}
	    				else x[j]=rgen.nextInt(N+1);
	    				if(rgen.nextBoolean())
	    				{
	    					if(rgen.nextBoolean())
	    						y[j]=0;
	    					else
	    						y[j]=M;
	    				}
	    				else y[j]=rgen.nextInt(M+1);
	    				if(ok(x, y))
	    				{
	    					ret = getRet(x, y);
	    					if(ret>best)
	    	    			{
	    	    				sb = new StringBuilder();
	    	    				sb.append(x[0]+" "+y[0]+"\n");
	    	        			sb.append(x[1]+" "+y[1]+"\n");
	    	        			sb.append(x[2]+" "+y[2]+"\n");
	    	        			sb.append(x[3]+" "+y[3]+"\n");
	    	        			best = ret;
	    	    			}
	    				}
    				}
    			}
    			//System.out.println(best);
    		}
        	System.out.println(sb);
    		closeInput();	
        }

		private boolean ok(int[] x, int[] y) {
			for(int i=0; i<3; i++)
			{
				for(int j=i+1; j<4; j++)
				{
					if(x[i]==x[j]&&y[i]==y[j])return false;
				}
			}
			return true;
		}

		private double getRet(int[] x, int[] y) {
			double ret = 0;
			for(int i=0; i<3; i++)
			{
				ret += Math.sqrt((x[i+1]-x[i])*(x[i+1]-x[i])+(y[i+1]-y[i])*(y[i+1]-y[i]));
			}
			return ret;
		}
        
}