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.util.*;


public class Main{
    public Main(int n, int m) {
        this.n = n;
        this.m = m;
    }

    public static void main(String[] args) {

        MyScanner sc = new MyScanner();

        int n = sc.nextInt();
        int m = sc.nextInt();

        new Main(n, m).solve();
    }

    private final int n;
    private final int m;
    private double max = 0;
    private List<Pair> possible;
    private List<Pair> ans;

    private class Pair {
        public final int x;
        public final int y;

        public Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "x=" + x +
                    ", y=" + y +
                    '}';
        }

        @Override
        public boolean equals(Object obj) {
            if (obj instanceof Pair) {
                Pair other = (Pair) obj;
                return other.x == x && other.y == y;
            }

            return false;
        }

        public Pair shift(Pair diff) {
            return new Pair(x + diff.x, y + diff.y);
        }

        public double dist(Pair other) {
            double dx = x - other.x;
            double dy = y - other.y;

            return Math.sqrt(dx*dx + dy*dy);
        }

        public boolean isValid() {
            return 0 <= x && x <= n && 0 <= y && y <= m;
        }
    }

    private void solve() {
        List<Pair> corners = new ArrayList<>();
        corners.add(new Pair(0, 0));
        corners.add(new Pair(n, 0));
        corners.add(new Pair(0, m));
        corners.add(new Pair(n, m));

        possible = new ArrayList<>();
        for (Pair p : corners) {
            for (int x = -1; x <= 1; x++)
                for (int y = -1; y <= 1; y++) {
                    Pair p1 = p.shift(new Pair(x, y));
                    if (p1.isValid() && !possible.contains(p1))
                        possible.add(p1);
                }
        }

        List<Pair> seq = new ArrayList<>();
        bf(seq);

        for (Pair p : ans) {
            System.out.println(p.x + " " + p.y);
        }
    }

    private void bf(List<Pair> seq) {
        if (seq.size() == 4) {
            double dist = getLength(seq);
            if (dist > max) {
                max = dist;
                ans = new ArrayList<>(seq);
            }
            return;
        }

        for (Pair p : possible) {
            if (seq.contains(p)) {
                continue;
            }

            seq.add(p);
            bf(seq);
            seq.remove(p);
        }
    }

    private double getLength(List<Pair> seq) {
        double res = 0;

        Pair last = seq.get(0);
        for (int i = 1; i < seq.size(); i++) {
            Pair cur = seq.get(i);
            res += cur.dist(last);
            last = cur;
        }

        return res;
    }

    private void report(int x, int y) {
        System.out.println(x + " " + y);
    }


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}