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.FileNotFoundException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.HashSet;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.FileReader;
import java.util.Set;
import java.util.StringTokenizer;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author abra
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB extends SimpleSavingChelperSolution {

	public void solve(int testNumber) {
		int n = in.nextInt();
		int m = in.nextInt();

		int[][][] variants = {
				{{0, 1}, {0, m}, {0, 0}, {0, m - 1}},
				{{1, 0}, {n, 0}, {0, 0}, {n - 1, 0}},

				{{0, 0}, {n, m}, {n, 0}, {0, m}},
				{{0, 0}, {n, m}, {0, m}, {n, 0}},

				{{0, 1}, {n, m}, {0, 0}, {n - 1, m}},
				{{0, 1}, {n, m}, {0, 0}, {n, m - 1}},

				{{1, 0}, {n, m}, {0, 0}, {n - 1, m}},
				{{1, 0}, {n, m}, {0, 0}, {n, m - 1}},
		};

		int[][] winner = null;
		double max = -1;

		for (int[][] variant : variants) {
			boolean ok = true;
			Set<Couple<Integer>> set = new HashSet<>();
			for (int i = 0; i < 4; i++) {
				if (variant[i][0] < 0 || variant[i][0] > n
						|| variant[i][1] < 0 || variant[i][1] > m) {
					ok = false;
				}
				set.add(new Couple<>(variant[i][0], variant[i][1]));
			}
			if (!ok || set.size() != 4) {
				continue;
			}

			double d = 0;
			for (int i = 0; i < 3; i++) {
				d += Math.hypot(variant[i][0] - variant[i + 1][0],
						variant[i][1] - variant[i + 1][1]);
			}

			if (d > max) {
				max = d;
				winner = variant;
			}
		}

		for (int[] ints : winner) {
			out.println(ints[0] + " " + ints[1]);
		}
	}
}

abstract class SimpleSavingChelperSolution extends SavingChelperSolution {

	public String processOutputPreCheck(int testNumber, String output) {
		return output;
	}

	public String processOutputPostCheck(int testNumber, String output) {
		return output;
	}
}

class InputReader {

	BufferedReader br;
	StringTokenizer in;

	public InputReader(String fileName) {
		try {
			br = new BufferedReader(new FileReader(fileName));
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	public InputReader(InputStream inputStream) {
		br = new BufferedReader(new InputStreamReader(inputStream));
	}

	boolean hasMoreTokens() {
		while (in == null || !in.hasMoreTokens()) {
			String s = nextLine();
			if (s == null) {
				return false;
			}
			in = new StringTokenizer(s);
		}
		return true;
	}

	public String nextString() {
		return hasMoreTokens() ? in.nextToken() : null;
	}

	public String nextLine() {
		try {
			in = null; // riad legacy
			return br.readLine();
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

	public int nextInt() {
		return Integer.parseInt(nextString());
	}

}

class Couple<A> extends Pair<A, A> {

	public Couple(A first, A second) {
		super(first, second);
	}
}

abstract class SavingChelperSolution {

	protected int testNumber;

	public InputReader in;
	public OutputWriter out;

	private OutputWriter toFile;

	public SavingChelperSolution() {
		try {
			toFile = new OutputWriter("last_test_output.txt");
		} catch (FileNotFoundException e) {
			throw new RuntimeException(e);
		}
	}

	public abstract void solve(int testNumber);

	public abstract String processOutputPreCheck(int testNumber, String output);

	public abstract String processOutputPostCheck(int testNumber, String output);

	public void solve(int testNumber, InputReader in, OutputWriter out) {
		this.testNumber = testNumber;

		ByteArrayOutputStream substituteOutContents = new ByteArrayOutputStream();
		OutputWriter substituteOut = new OutputWriter(substituteOutContents);

		this.in = in;
		this.out = substituteOut;

		solve(testNumber);
		substituteOut.flush();

		String result = substituteOutContents.toString();

		result = processOutputPreCheck(testNumber, result);
		out.print(result);
		out.flush();

		result = processOutputPostCheck(testNumber, result);
		toFile.print(result);
		toFile.flush();
	}

}

class Pair<A, B> {

	public final A first;
	public final B second;

	public Pair(A first, B second) {
		if (first == null || second == null) {
			throw new IllegalArgumentException();
		}

		this.first = first;
		this.second = second;
	}

	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof Pair)) {
			return false;
		}

		Pair pair = (Pair) o;

		if (!first.equals(pair.first)) {
			return false;
		}
		if (!second.equals(pair.second)) {
			return false;
		}

		return true;
	}

	public int hashCode() {
		int result = first.hashCode();
		result = 31 * result + second.hashCode();
		return result;
	}

	public String toString() {
		return "{" + first + ", " + second + "}";
	}
}

class OutputWriter extends PrintWriter {

	public OutputWriter(String fileName) throws FileNotFoundException {
		super(fileName);
	}

	public OutputWriter(OutputStream outputStream) {
		super(outputStream);
	}

	public OutputWriter(Writer writer) {
		super(writer);
	}

}