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.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class B {
	FastScanner in = new FastScanner(System.in);
	PrintWriter out = new PrintWriter(System.out);
	
	public void run() {
		int n = in.nextInt(), m = in.nextInt();		
		
		int x1, x2, x3, x4, y1, y2, y3, y4;
		
		if (n == 0) {
			x1 = 0; y1 = 1;
			x2 = 0; y2 = m;
			x3 = 0; y3 = 0;
			x4 = 0; y4 = m - 1;
		} else if (m == 0) {
			x1 = 1; y1 = 0;
			x2 = n; y2 = 0;
			x3 = 0; y3 = 0;
			x4 = n - 1; y4 = 0;
		} else {
			x1 = 0; y1 = 0;
			x2 = n; y2 = m;
			x3 = n; y3 = 0;
			x4 = 0; y4 = m;
			double length = 2 * n * n + 3 * m * m;
			
			if (length < 3 * n * n + 2 * m * m) {
				x1 = 0; y1 = 0;
				x2 = n; y2 = m;
				x3 = 0; y3 = m;
				x4 = n; y4 = 0;
				length = 3 * n * n + 2 * m * m;
			} 

			if (m >= 3 && length < 3 * n * n + 3 * m * m - 4 * m + 2) {
				x1 = n; y1 = m-1;
				x2 = 0; y2 = 0;
				x3 = n; y3 = m;
				x4 = 0; y4 = 1;
				length = 3 * n * n + 3 * m * m - 4 * m + 2;
			}
			if (n >= 3 && length < 3 * m * m + 3 * n * n - 4 * n + 2) {
				x1 = n-1; y1 = m;
				x2 = 0; y2 = 0;
				x3 = n; y3 = m;
				x4 = 1; y4 = 0;
				length = 3 * m * m + 3 * n * n - 4 * n + 2;
			}
			
			/*
			if (m % 2 == 0 && length > 5 * n * n + 2 * m * m) {
				x1 = 0; y1 = 0;
				x2 = n; y2 = m / 2;
				x3 = 0; y3 = m;
				x4 = n; y4 = 0;
				length = 5 * n * n + 2 * m * m;
			}
			if (m % 2 == 1 && m > 2 && length > 1.0/2.0 * m * m + 2 * n * n + m * m + n * n) {
				x1 = 0; y1 = 0;
				x2 = n; y2 = m / 2;
				x3 = 0; y3 = m;
				x4 = n; y4 = 0;
				length = 5 * n * n + 2 * m * m;
			}
			
			if (n % 2 == 0 && length > 5 * m * m + 2 * n * n) {
				x1 = 0; y1 = 0;
				x2 = n / 2; y2 = m;
				x3 = n; y3 = 0;
				x4 = 0; y4 = m;
				length = 5 * m * m + 2 * n * n;
			}
			
			if (m % 3 == 0 && length > 9 * n * n + m * m) {
				x1 = 0; y1 = 0;
				x2 = n; y2 = m / 3;
				x3 = 0; y3 = m / 3 * 2;
				x4 = n; y4 = m;
				length = 9 * n * n + m * m;
			} 
			if (m % 3 == 1 && m > 3 && length > 1.0/9.0 * m * m + n * n + 1.0/18.0 * m * m + 2 * n * n) {
				x1 = 0; y1 = 0;
				x2 = n; y2 = m / 3 + 1;
				x3 = 0; y3 = m / 3 * 2 + 1;
				x4 = n; y4 = m;
				length = 1.0/9.0 * m * m + n * n + 1.0/18.0 * m * m + 2 * n * n;
			}
			if (m % 3 == 2 && m > 3 && length > 4.0/9.0 * m * m + 4 * n * n + 1.0/36.0 * m * m + n * n) {
				x1 = 0; y1 = 0;
				x2 = n; y2 = m / 3 + 1;
				x3 = 0; y3 = m / 3 * 2 + 2;
				x4 = n; y4 = m;
				length = 4.0/9.0 * m * m + 4 * n * n + 1.0/36.0 * m * m + n * n;
			}
			
			if (n % 3 == 0 && length > n * n + 9 * m * m) {
				x1 = 0; y1 = 0;
				x2 = n / 3; y2 = m;
				x3 = n / 3 * 2; y3 = 0;
				x4 = n; y4 = m;
				length = n * n + 9 * m * m;
			} 
			if (n % 3 == 1 && n > 3 && length > 1.0/9.0 * n * n + m * m + 1.0/18.0 * n * n + 2 * m * m) {
				x1 = 0; y1 = 0;
				x2 = n / 3 + 1; y2 = m;
				x3 = n / 3 * 2 + 1; y3 = 0;
				x4 = n; y4 = m;
				length = 1.0/9.0 * n * n + m * m + 1.0/18.0 * n * n + 2 * m * m;
			}
			if (n % 3 == 2 && n > 3 && length > 4.0/9.0 * n * n + 4 * m * m + 1.0/36.0 * n * n + m * m) {
				x1 = 0; y1 = 0;
				x2 = n / 3 + 1; y2 = m;
				x3 = n / 3 * 2 + 2; y3 = 0;
				x4 = n; y4 = m;
				length = 4.0/9.0 * n * n + 4 * m * m + 1.0/36.0 * n * n + m * m;
			}
			
			*/
		}
		
		System.out.println(x1 + " " + y1);
		System.out.println(x2 + " " + y2);
		System.out.println(x3 + " " + y3);
		System.out.println(x4 + " " + y4);
		
		out.close();
	}

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

	public void mapDebug(int[][] a) {
		System.out.println("--------map display---------");

		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				System.out.printf("%3d ", a[i][j]);
			}
			System.out.println();
		}

		System.out.println("----------------------------");
		System.out.println();
	}

	public void debug(Object... obj) {
		System.out.println(Arrays.deepToString(obj));
	}

	class FastScanner {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public FastScanner(InputStream stream) {
			this.stream = stream;
			//stream = new FileInputStream(new File("dec.in"));

		}

		int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		boolean isEndline(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String next() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		String nextLine() {
			int c = read();
			while (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}
}