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.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.*;
import java.math.*;
import java.text.*; 
import java.util.*;
import java.util.regex.*;

/*
  br = new BufferedReader(new FileReader("input.txt"));
  pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
  br = new BufferedReader(new InputStreamReader(System.in));
  pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
 */


public class Main {
	private static BufferedReader br;
	private static StringTokenizer st;
	private static PrintWriter pw;

	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		//int qq = 1;
		int qq = Integer.MAX_VALUE;
		//int qq = readInt();
		for(int casenum = 1; casenum <= qq; casenum++) {
			int r = readInt();
			int c = readInt();
			Set<State> set = new HashSet<State>();
			for(int i = 0; i <= 2 && i <= c; i++) {
				set.add(new State(0, i));
				set.add(new State(r, i));
			}
			for(int i = c; i >= 0 && i >= c-2; i--) {
				set.add(new State(0, i));
				set.add(new State(r, i));
			}
			for(int i = 0; i <= 2 && i <= r; i++) {
				set.add(new State(i, 0));
				set.add(new State(i, c));
			}
			for(int i = r; i >= r-2 && i >= 0; i--) {
				set.add(new State(i, 0));
				set.add(new State(i, c));
			}
			ArrayList<State> list = new ArrayList<State>();
			for(State out: set) {
				list.add(out);
			}
			double ret = 0;
			State aa = null;
			State bb = null;
			State cc = null;
			State dd = null;
			for(int qqq = 0; qqq < 100000; qqq++) {
				Collections.shuffle(list);
				double curr = list.get(0).dist(list.get(1));
				curr += list.get(1).dist(list.get(2));
				curr += list.get(2).dist(list.get(3));
				if(curr > ret){
					ret = curr;
					aa = new State(list.get(0));
					bb = new State(list.get(1));
					cc = new State(list.get(2));
					dd = new State(list.get(3));
				}
			}
			pw.println(aa);
			pw.println(bb);
			pw.println(cc);
			pw.println(dd);
		}
		exitImmediately();
	}

	static class State {
		public int x,y;

		public State(State s) {
			x = s.x;
			y = s.y;
		}
		
		public String toString() {
			return x + " " + y;
		}
		
		public double dist(State s) {
			int xx = x - s.x;
			int yy = y - s.y;
			return Math.sqrt(xx*xx+yy*yy);
		}
		
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + x;
			result = prime * result + y;
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			State other = (State) obj;
			if (x != other.x)
				return false;
			if (y != other.y)
				return false;
			return true;
		}

		public State(int x, int y) {
			super();
			this.x = x;
			this.y = y;
		}
		
	}
	
	private static void exitImmediately() {
		pw.close();
		System.exit(0);
	}

	private static long readLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	private static double readDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	private static int readInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	private static String nextLine() throws IOException  {
		if(!br.ready()) {
			exitImmediately();
		}
		st = null;
		return br.readLine();
	}

	private static String nextToken() throws IOException  {
		while(st == null || !st.hasMoreTokens())  {
			if(!br.ready()) {
				exitImmediately();
			}
			st = new StringTokenizer(br.readLine().trim());
		}
		return st.nextToken();
	}
}