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 static java.lang.Math.*; 
import java.io.*; 
import java.util.*; 

public class A {
	BufferedReader in; 
	PrintWriter out;
	StringTokenizer st; 


	public String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(in.readLine());
			} catch(Exception e) {}
		}
		return st.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next()); 
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public double nextDouble() {
		return Double.parseDouble(next()); 
	}

	boolean bit(int m, int i) {
		return (m & (1 << i)) > 0; 
	}

	long inf = 10000000000000000L;

	int n,m, h, t; 

	void db(String ss){
		System.err.println(ss);
	} 

	long ans=0;
	int[] a = new int[10];

	long d(int x1, int y1, int x2, int y2) {
		return (x2 - x1) * 1L * (x2 - x1) + (y2 - y1) * 1L * (y2 - y1);
	} 

	int[][] f = new int[50][50];
	int r=0; 
	void relax(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
		/*r++; 
		f[x1][y1] = r; 
		if (f[x2][y2] == r) return;else f[x2][y2]=r;
		if (f[x3][y3] == r) return;else f[x3][y3]=r;
		if (f[x4][y4] == r) return;else f[x4][y4]=r;*/
		long cur = d(x1, y1, x2, y2) + d(x2, y2, x3, y3) + d(x3, y3, x4, y4); 
		if (cur > ans) {
			ans = cur;
			a[0] = x1; 
			a[1] = y1; 
			a[2] = x2; 
			a[3] = y2; 
			a[4] = x3; 
			a[5] = y3; 
			a[6] = x4; 
			a[7] = y4; 
		}
	}
	
	public void run() {
		in  = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		n = nextInt(); 
		m = nextInt();

		/*for (int x1=0; x1 <=n; x1++)
			for (int y1=0; y1<=m; y1++)
		for (int x2=0; x2 <=n; x2++)
			for (int y2=0; y2<=m; y2++)
				for (int x3=0; x3<=n; x3++)
					for (int y3=0; y3<=m; y3++)
						for (int x4=0; x4<=n; x4++)
							for (int y4=0; y4<=m; y4++) relax(x1, y1, x2, y2, x3, y3, x4, y4);*/


		if (m>2) relax(0,1,0,m,0,0,0, m-1);
		if (n>2) relax(1,0,n,0,0,0,n-1,0);
		if (n>0 && m>0) {
			boolean[][] u = new boolean[n+1][m+1];
			ArrayList<Pair> q = new ArrayList<Pair>();
			q.add(new Pair(0, 0)); u[0][0] = true;
			q.add(new Pair(0, 1)); u[0][1] = true; 
			q.add(new Pair(1, 0)); u[1][0] = true;
			//q.add(new Pair(1, 1)); u[1][1] = true;
			if (!u[n][m]) {q.add(new Pair(n, m)); u[n][m] = true;}
			if (!u[n][m-1]) {q.add(new Pair(n, m-1)); u[n][m-1] = true;}
			if (!u[n-1][m]) {q.add(new Pair(n-1, m)); u[n-1][m] = true;}
			//if (!u[n-1][m-1]) {q.add(new Pair(n-1, m-1)); u[n-1][m-1] = true;}
			if (!u[0][m]) {q.add(new Pair(0, m)); u[0][m] = true;}
			if (!u[1][m]) {q.add(new Pair(1, m)); u[1][m] = true;}
			if (!u[0][m-1]) {q.add(new Pair(0, m-1)); u[0][m-1] = true;}

			if (!u[n][0]) {q.add(new Pair(n, 0)); u[n][0] = true;}
			if (!u[n][1]) {q.add(new Pair(n, 1)); u[n][1] = true;}
			if (!u[n-1][0]) {q.add(new Pair(n-1, 0)); u[n-1][0] = true;}
			
			for (int x1=0; x1<q.size(); x1++)
				for (int x2=0; x2<q.size(); x2++) if (x1 != x2)
					for (int x3=0; x3<q.size(); x3++) if (x3 != x1 && x3 != x2)
						for (int x4=0; x4<q.size(); x4++) if (x4 != x1 && x4 != x2 && x4 != x3) relax(q.get(x1).x,q.get(x1).y,q.get(x2).x,q.get(x2).y,q.get(x3).x,q.get(x3).y,q.get(x4).x,q.get(x4).y);

		}

		for (int i=0; i<8; i+=2) out.println(a[i] + " " + a[i+1]);
		out.close(); 	
	}

	class Pair implements Comparable<Pair> {
		int x,y; 
		public Pair(int x, int y) {
			this.x=x; 
			this.y=y; 
		}
		public int compareTo(Pair o) {
			if (x != o.x) return x - o.x; 
			return o.y - y; 
		}
	}

	int sign(long x) {
		if (x < 0) return -1; 
		if (x > 0) return 1; 
		return 0;
	}

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