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.util.*;

public class B
{
	private static int [] x, y;
	private static int [] xr, yr;
	private static double max;
	public static void main(String[] args) throws IOException
	{
		Scanner in = new Scanner(System.in);

		int n = in.nextInt();
		int m = in.nextInt();

		int p1x = 0;
		int p1y = 0;
		int p2x = n;
		int p2y = m;

		x = new int[4];
		y = new int[4];

		xr = new int[4];
		yr = new int[4];

		x[1] = p1x;
		x[2] = p2x;

		y[1] = p1y;
		y[2] = p2y;

		max = 0;
		for(int a = 0 ; a < 2*(n+m) ; a++)
			for(int b = a+1 ; b < 2*(n+m) ; b++)
			{
				int p3x, p3y, p4x, p4y;

				//third
				if(a <= n)
				{
					p3y = 0;
					p3x = a;
				}
				else if(a <= n+m)
				{
					p3y = a-n;
					p3x = n;
				}
				else if(a <= n+m+n)
				{
					p3y = m;
					p3x = n-(a-n-m);
				}
				else
				{
					p3y = m-(a-n-m-n);
					p3x = 0;
				}

				//fourth
				if(b <= n)
				{
					p4y = 0;
					p4x = b;
				}
				else if(b <= n+m)
				{
					p4y = b-n;
					p4x = n;
				}
				else if(b <= n+m+n)
				{
					p4y = m;
					p4x = n-(b-n-m);
				}
				else
				{
					p4y = m-(b-n-m-n);
					p4x = 0;
				}

				if(p1x == p3x && p1y == p3y)
					continue;
				if(p1x == p4x && p1y == p4y)
					continue;
				if(p2x == p3x && p2y == p3y)
					continue;
				if(p2x == p4x && p2y == p4y)
					continue;

				x[0] = p3x;
				x[3] = p4x;

				y[0] = p3y;
				y[3] = p4y;

				double c1 = 0;
				for(int i = 0 ; i < 3 ; i++)
					c1 += dis(x[i], y[i], x[i+1], y[i+1]);

				if(c1 > max)
				{
					max = c1;
					xr = x.clone();
					yr = y.clone();
				}

				x[3] = p3x;
				x[0] = p4x;

				y[3] = p3y;
				y[0] = p4y;

				c1 = 0;
				for(int i = 0 ; i < 3 ; i++)
					c1 += dis(x[i], y[i], x[i+1], y[i+1]);

				if(c1 > max)
				{
					max = c1;
					xr = x.clone();
					yr = y.clone();
				}

			}

		x[0] = p1x;
		x[1] = p2x;

		y[0] = p1y;
		y[1] = p2y;

		for(int a = 0 ; a < 2*(n+m) ; a++)
			for(int b = a+1 ; b < 2*(n+m) ; b++)
			{
				int p3x, p3y, p4x, p4y;

				//third
				if(a <= n)
				{
					p3y = 0;
					p3x = a;
				}
				else if(a <= n+m)
				{
					p3y = a-n;
					p3x = n;
				}
				else if(a <= n+m+n)
				{
					p3y = m;
					p3x = n-(a-n-m);
				}
				else
				{
					p3y = m-(a-n-m-n);
					p3x = 0;
				}

				//fourth
				if(b <= n)
				{
					p4y = 0;
					p4x = b;
				}
				else if(b <= n+m)
				{
					p4y = b-n;
					p4x = n;
				}
				else if(b <= n+m+n)
				{
					p4y = m;
					p4x = n-(b-n-m);
				}
				else
				{
					p4y = m-(b-n-m-n);
					p4x = 0;
				}

				if(p1x == p3x && p1y == p3y)
					continue;
				if(p1x == p4x && p1y == p4y)
					continue;
				if(p2x == p3x && p2y == p3y)
					continue;
				if(p2x == p4x && p2y == p4y)
					continue;

				x[2] = p3x;
				x[3] = p4x;

				y[2] = p3y;
				y[3] = p4y;

				double c1 = 0;
				for(int i = 0 ; i < 3 ; i++)
					c1 += dis(x[i], y[i], x[i+1], y[i+1]);

				if(c1 > max)
				{
					max = c1;
					xr = x.clone();
					yr = y.clone();
				}

				x[3] = p3x;
				x[2] = p4x;

				y[3] = p3y;
				y[2] = p4y;

				c1 = 0;
				for(int i = 0 ; i < 3 ; i++)
					c1 += dis(x[i], y[i], x[i+1], y[i+1]);

				if(c1 > max)
				{
					max = c1;
					xr = x.clone();
					yr = y.clone();
				}

			}

		for(int i = 0 ; i < 4 ; i++)
			System.out.println(xr[i]+" "+yr[i]);

	}

	private static double dis(int x1, int y1, int x2, int y2)
	{
		double d1 = x1 - x2;
		double d2 = y1 - y2;

		return Math.sqrt(d1*d1 + d2*d2);
	}

}