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.util.ArrayList;
import java.util.Scanner;

public class Polyline {
	
	static ArrayList<Point> result;
	static int maxDis;
	
	public static void main(String [] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		result = new ArrayList<Point>();
		getResult(n, m);
		sc.close();
	}
	
	static void getResult(int n, int m) {
		ArrayList<Point> allPoints = generatePoints(n, m);
		brute(allPoints);
		print(result);
	}
	
	static void print(ArrayList<Point> res) {
		for(Point cur: res) {
			System.out.println(cur.x +  " " + cur.y);
		}
	}
	
	static int getDis(Point a, Point b) {
		int delx = a.x - b.x;
		int dely = a.y - b.y;
		return delx*delx+dely*dely;
	}
	
	static void test(Point a, Point b, Point c, Point d) {
		int dis = getDis(a, b) + getDis(b, c) + getDis(c, d);
		if(dis>maxDis) {
			maxDis = dis;
			result.clear();
			result.add(a);result.add(b);result.add(c);result.add(d);
		}
	}
	
	public static void  brute(ArrayList<Point> all) {
		for(Point a:all) {
			for(Point b:all) {
				if(a.equals(b)) {
					continue;
				}
				for(Point c:all) {
					if(a.equals(c)||b.equals(c)) {
						continue;
					}
					else {
						for(Point d:all) {
							if(a.equals(d)||b.equals(d)||c.equals(d)) {
								continue;
							}
							test(a, b, c, d);
						}
					}
				}
			}
		}
	}
	
	
	public static ArrayList<Point> generatePoints(int n, int m){
		ArrayList<Point> ret = new ArrayList<Point>();
		ret.addAll(around(0, 0, 1, 1));
		ret.addAll(around(0, m, 1, -1));
		ret.addAll(around(n, 0, -1, 1));
		ret.addAll(around(n, m, -1, -1));
		clear(ret, n, m);
		return ret;
	}
	
	static void clear(ArrayList<Point> ret, int n, int m) {
		for(Point cur:ret) {
			if(cur.x<0||cur.x>n||cur.y<0||cur.y>m) {
				cur.x=0; cur.y=0;
			}
		}
	}
	
	public static ArrayList<Point> around(int a, int b, int delx, int dely) {
		ArrayList<Point> ret = new ArrayList<>();
		ret.add(new Point(a, b));
		ret.add(new Point(a + delx, b));
		ret.add(new Point(a, b + dely));
		return ret;
		
	}
	
	static class Point{
		public int x, y;
		
		public Point(int curx, int cury) {
			x = curx; y = cury;
		}
		
		public boolean equals(Point other) {
			return this.x ==other.x&&this.y==other.y;
		}
	}
}