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.*;
import java.math.*;
import java.util.*;
import java.util.concurrent.*;

public class P452B {

  ArrayList<int []> xy = new ArrayList<int []>();

  int sqr(int x) {
    return (x * x);
  }

  int len1(int i, int j) {
    return (sqr(xy.get(i)[0] - xy.get(j)[0]) + sqr(xy.get(i)[1] - xy.get(j)[1]));
  }

  int len(int i, int j, int k, int l) {
    return (len1(i, j) + len1(j, k) + len1(k, l)/* + len1(l, i)*/);
  }

  void xyAdd(int [] a) {
    for (int i = 0; i < xy.size(); i++) {
      if ((xy.get(i)[0] == a[0]) && (xy.get(i)[1] == a[1])) {
        return;
      }
    }
    xy.add(a);
  }

  @SuppressWarnings("unchecked")
  public void run() throws Exception {
    int n = nextInt();
    int m = nextInt();

    xyAdd(new int [] {0, 0});
    xyAdd(new int [] {n, 0});
    xyAdd(new int [] {0, m});
    xyAdd(new int [] {n, m});
    if (n > 0) {
      xyAdd(new int [] {    1, 0});
      xyAdd(new int [] {    1, m});
      xyAdd(new int [] {n - 1, 0});
      xyAdd(new int [] {n - 1, m});
    }
    if (m > 0) {
      xyAdd(new int [] {0,     1});
      xyAdd(new int [] {n,     1});
      xyAdd(new int [] {0, m - 1});
      xyAdd(new int [] {n, m - 1});
    }
    //for (int [] i : xy) print(Arrays.toString(i));

    int max = 0;
    int m1 = 0;
    int m2 = 0;
    int m3 = 0;
    int m4 = 0;

    for (int i1 = 0; i1 < xy.size(); i1++) {
      for (int i2 = 0; i2 < xy.size(); i2++) {
        if (i2 != i1) {
          for (int i3 = 0; i3 < xy.size(); i3++) {
            if ((i3 != i1) && (i3 != i2)) {
              for (int i4 = 0; i4 < xy.size(); i4++) {
                if ((i4 != i1) && (i4 != i2) && (i4 != i3)) {
                  int len = len(i1, i2, i3, i4);
                  if (len > max) {
                    m1 = i1; m2 = i2; m3 = i3; m4 = i4;
                    max = len;
                  }
                }
              }
            }
          }
        }
      }
    }

    println(xy.get(m1)[0] + " " + xy.get(m1)[1]);
    println(xy.get(m2)[0] + " " + xy.get(m2)[1]);
    println(xy.get(m3)[0] + " " + xy.get(m3)[1]);
    println(xy.get(m4)[0] + " " + xy.get(m4)[1]);
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P452B().run();
    br.close();
    pw.close();
  }

  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) { return null; }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) { print("" + b); }
  void print(int i) { print("" + i); }
  void print(long l) { print("" + l); }
  void print(double d) { print("" + d); }
  void print(char c) { print("" + c); }
  void print(Object o) {
    if (o instanceof int[]) { print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) { print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) { print(Arrays.toString((char [])o));
    } else if (o instanceof byte[]) { print(Arrays.toString((byte [])o));
    } else if (o instanceof short[]) { print(Arrays.toString((short [])o));
    } else if (o instanceof boolean[]) { print(Arrays.toString((boolean [])o));
    } else if (o instanceof float[]) { print(Arrays.toString((float [])o));
    } else if (o instanceof double[]) { print(Arrays.toString((double [])o));
    } else if (o instanceof Object[]) { print(Arrays.toString((Object [])o));
    } else { println("" + o); }
  }
  void print(String s) { pw.print(s); }
  void println() { println(""); }
  void println(byte b) { println("" + b); }
  void println(int i) { println("" + i); }
  void println(long l) { println("" + l); }
  void println(double d) { println("" + d); }
  void println(char c) { println("" + c); }
  void println(Object o) { print("" + o); }
  void println(String s) { pw.println(s); }
  int nextInt() throws IOException { return Integer.parseInt(nextToken()); }
  long nextLong() throws IOException { return Long.parseLong(nextToken()); }
  double nextDouble() throws IOException { return Double.parseDouble(nextToken()); }
  char nextChar() throws IOException { return (char) (br.read()); }
  String next() throws IOException { return nextToken(); }
  String nextLine() throws IOException { return br.readLine(); }
  int [] readInt(int size) throws IOException {
    int [] array = new int [size];
    for (int i = 0; i < size; i++) { array[i] = nextInt(); }
    return array;
  }
  long [] readLong(int size) throws IOException {
    long [] array = new long [size];
    for (int i = 0; i < size; i++) { array[i] = nextLong(); }
    return array;
  }
  double [] readDouble(int size) throws IOException {
    double [] array = new double [size];
    for (int i = 0; i < size; i++) { array[i] = nextDouble(); }
    return array;
  }
  String [] readLines(int size) throws IOException {
    String [] array = new String [size];
    for (int i = 0; i < size; i++) { array[i] = nextLine(); }
    return array;
  }
}