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.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.StringTokenizer;


public class B {
	static String ans;
	static double best = 0.0;
	static Point[] points;
	public static void main(String[] args) throws Exception{
		int n = readInt();
		int m = readInt();
		HashSet<Point> hs = new HashSet<Point>();
		hs.add(new Point(0, 0));
		hs.add(new Point(n, m));
		hs.add(new Point(Math.max(n-1,0) , m));
		hs.add(new Point(n, Math.max(0, m-1)));
		hs.add(new Point(Math.min(1, n), 0));
		hs.add(new Point(0, Math.min(1, m)));
		hs.add(new Point(n, 0));
		hs.add(new Point(0, m));
		points = hs.toArray(new Point[hs.size()]);
		boolean[] used = new boolean[points.length];
		for(int i = 0; i < points.length; i++){
			used[i] = true;
			rec(used, points[i], 1, 0.0, Integer.toString(i));
			used[i] = false;
		}
		for(int i = 0; i<4; i++){
			System.out.println(points[ans.charAt(i)-'0'].toString());
		}
	}
	static void rec(boolean[] used, Point prevPoint, int count, double dist, String s){
		if(count == 4){
			if(dist > best){
				ans = s;
				best = dist;
			}
		}
		else{
			for(int i = 0; i< points.length; i++){
				if(!used[i]){
					used[i] = true;
					rec(used, points[i], count+1, dist+distance(prevPoint, points[i]), s+i);
					used[i] = false;
				}
			}
		}
	}
	
	static double distance(Point a, Point b){
		double x = a.a - b.a;
		x = x*x;
		double y = a.b - b.b;
		y = y*y;
		return Math.sqrt(x+y);
	}
	static class Point{
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + a;
			result = prime * result + b;
			return result;
		}
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Point other = (Point) obj;
			if (a != other.a)
				return false;
			if (b != other.b)
				return false;
			return true;
		}
		int a;
		int b;
		Point(int aa, int bb){
			a = aa;
			b = bb;
		}
		@Override
		public String toString() {
			return a + " " + b;
		}
		
	}
	static BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
	static StringTokenizer st = new StringTokenizer(" ");
	static String readString() throws Exception{
		while(!st.hasMoreTokens()){
			st = new StringTokenizer(stdin.readLine());
		}
		return st.nextToken();
	}
	static int readInt() throws Exception {
		return Integer.parseInt(readString());
	}
	static long readLong() throws Exception {
		return Long.parseLong(readString());
	}
}