Problem: Petya has recently started working as a programmer in the IT city company that develops computer games.

Besides game mechanics implementation to create a game it is necessary to create tool programs that can be used by game designers to create game levels. Petya's first assignment is to create a tool that allows to paint different arrows on the screen.

A user of this tool will choose a point on the screen, specify a vector (the arrow direction) and vary several parameters to get the required graphical effect. In the first version of the program Petya decided to limit parameters of the arrow by the following: a point with coordinates (px, py), a nonzero vector with coordinates (vx, vy), positive scalars a, b, c, d, a > c.

The produced arrow should have the following properties. The arrow consists of a triangle and a rectangle. The triangle is isosceles with base of length a and altitude of length b perpendicular to the base. The rectangle sides lengths are c and d. Point (px, py) is situated in the middle of the triangle base and in the middle of side of rectangle that has length c. Area of intersection of the triangle and the rectangle is zero. The direction from (px, py) point to the triangle vertex opposite to base containing the point coincides with direction of (vx, vy) vector.

Enumerate the arrow points coordinates in counter-clockwise order starting from the tip.

<image>

Input

The only line of the input contains eight integers px, py, vx, vy ( - 1000 ≤ px, py, vx, vy ≤ 1000, vx2 + vy2 > 0), a, b, c, d (1 ≤ a, b, c, d ≤ 1000, a > c).

Output

Output coordinates of the arrow points in counter-clockwise order. Each line should contain two coordinates, first x, then y. Relative or absolute error should not be greater than 10 - 9.

Examples

Input

8 8 0 2 8 3 4 5


Output

8.000000000000 11.000000000000
4.000000000000 8.000000000000
6.000000000000 8.000000000000
6.000000000000 3.000000000000
10.000000000000 3.000000000000
10.000000000000 8.000000000000
12.000000000000 8.000000000000

Solution (in JAVA):

Solution:




import java.io.*;

import java.util.*;


/**
 * Created by L i o n on 9/6/2016.
 */
public class Main {
    //Template
    //UVa 11094
    public static PrintWriter out;

    //-----------MyScanner class for faster input----------
    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;
        }

    }


    public static void main(String[] args) {

        out = new PrintWriter(new BufferedOutputStream(System.out));
        task solver = new task();
        solver.solve();
        out.close();


    }

    static class task {

        public void solve() {
            MyScanner in = new MyScanner();
            StringTokenizer idata=new StringTokenizer(in.nextLine());
            point[] pts=new point[7];
            double px=Integer.parseInt(idata.nextToken());
            double py=Integer.parseInt(idata.nextToken());
            double vx=Integer.parseInt(idata.nextToken());
            double vy=Integer.parseInt(idata.nextToken());
            double a=Integer.parseInt(idata.nextToken());
            double b=Integer.parseInt(idata.nextToken());
            double c=Integer.parseInt(idata.nextToken());
            double d=Integer.parseInt(idata.nextToken());
            //vec P=new vec(px,py);
            point P=new point(px,py);
            vec V=new vec(vx,vy);
            V=scale(V,(1.0/Math.hypot(vx,vy)));
            vec Vr=new vec(-V.y,V.x);
            pts[0]=translate(P,scale(V,b));
            pts[1]=translate(P,scale(Vr,a/2.0));
            pts[2]=translate(P,scale(Vr,c/2.0));
            pts[3]=translate(pts[2],scale(V,-d));
            pts[5]=translate(P,scale(Vr,-c/2.0));
            pts[4]=translate(pts[5],scale(V,-d));
            pts[6]=translate(P,scale(Vr,-a/2.0));
            for(int i=0;i<7;i++){
                System.out.println(pts[i].x+" "+pts[i].y);
            }

        }
        final double EPS = 1e-9;

        double DEG_to_RAD(double d) { return d * Math.PI / 180.0; }
        double RAD_to_DEG(double r) { return r * 180.0 / Math.PI; }

        class point_i {
            int x, y;                  // whenever possible, work with point_i
            point_i() { x = y = 0; }                    // default constructor
            point_i(int _x, int _y) { x = _x; y = _y; }         // constructor
        };

        class point {
            double x, y;              // only used if more precision is needed
            point() { x = y = 0.0; }                    // default constructor
            point(double _x, double _y) { x = _x; y = _y; }     // constructor
        };

        double dist(point p1, point p2) {
            return Math.hypot(p1.x - p2.x, p1.y - p2.y); }

        double perimeter(double ab, double bc, double ca) {
            return ab + bc + ca; }

        double perimeter(point a, point b, point c) {
            return dist(a, b) + dist(b, c) + dist(c, a); }

        double area(double ab, double bc, double ca) {
            // Heron's formula, split sqrt(a * b) into sqrt(a) * sqrt(b); in implementation
            double s = 0.5 * perimeter(ab, bc, ca);
            return Math.sqrt(s) * Math.sqrt(s - ab) * Math.sqrt(s - bc) * Math.sqrt(s - ca); }

        double area(point a, point b, point c) {
            return area(dist(a, b), dist(b, c), dist(c, a)); }

        //====================================================================
        // from ch7_01_points_lines
        class line { double a, b, c; };              // a way to represent a line

        // the answer is stored in the third parameter
        void pointsToLine(point p1, point p2, line l) {
            if (Math.abs(p1.x - p2.x) < EPS) {             // vertical line is fine
                l.a = 1.0;   l.b = 0.0;   l.c = -p1.x;
            } else {
                l.a = -(double)(p1.y - p2.y) / (p1.x - p2.x);
                l.b = 1.0;                 // IMPORTANT: we fix the value of b to 1.0
                l.c = -(double)(l.a * p1.x) - p1.y;
            } }

        boolean areParallel(line l1, line l2) {       // check coefficients a & b
            return (Math.abs(l1.a-l2.a) < EPS) && (Math.abs(l1.b-l2.b) < EPS); }

        // returns true (+ intersection point) if two lines are intersect
        boolean areIntersect(line l1, line l2, point p) {
            if (areParallel(l1, l2)) return false;               // no intersection
            // solve system of 2 linear algebraic equations with 2 unknowns
            p.x = (l2.b * l1.c - l1.b * l2.c) / (l2.a * l1.b - l1.a * l2.b);
            // special case: test for vertical line to avoid division by zero
            if (Math.abs(l1.b) > EPS) p.y = -(l1.a * p.x + l1.c);
            else                      p.y = -(l2.a * p.x + l2.c);
            return true; }

        class vec { double x, y;     // name: `vec' is different from Java Vector
            vec(double _x, double _y) { x = _x; y = _y; } };

        vec toVec(point a, point b) {               // convert 2 points to vector
            return new vec(b.x - a.x, b.y - a.y); }

        vec scale(vec v, double s) {           // nonnegative s = [<1 .. 1 .. >1]
            return new vec(v.x * s, v.y * s); }              // shorter.same.longer

        point translate(point p, vec v) {           // translate p according to v
            return new point(p.x + v.x , p.y + v.y); }
        //====================================================================

        double rInCircle(double ab, double bc, double ca) {
            return area(ab, bc, ca) / (0.5 * perimeter(ab, bc, ca)); }

        double rInCircle(point a, point b, point c) {
            return rInCircle(dist(a, b), dist(b, c), dist(c, a)); }

        // assumption: the required points/lines functions have been written
        // returns 1 if there is an inCircle center, returns 0 otherwise
        // if this function returns 1, ctr will be the inCircle center
        // and r is the same as rInCircle
        int inCircle(point p1, point p2, point p3, point ctr, double r) {
            r = rInCircle(p1, p2, p3);
            if (Math.abs(r) < EPS) return 0;               // no inCircle center

            line l1 = new line(), l2 = new line(); // compute these two angle bisectors
            double ratio = dist(p1, p2) / dist(p1, p3);
            point p = translate(p2, scale(toVec(p2, p3), ratio / (1 + ratio)));
            pointsToLine(p1, p, l1);

            ratio = dist(p2, p1) / dist(p2, p3);
            p = translate(p1, scale(toVec(p1, p3), ratio / (1 + ratio)));
            pointsToLine(p2, p, l2);

            areIntersect(l1, l2, ctr);           // get their intersection point
            return 1; }

        double rCircumCircle(double ab, double bc, double ca) {
            return ab * bc * ca / (4.0 * area(ab, bc, ca)); }

        double rCircumCircle(point a, point b, point c) {
            return rCircumCircle(dist(a, b), dist(b, c), dist(c, a)); }

        // assumption: the required points/lines functions have been written
        // returns r, the radius of the circumCircle if there is a circumCenter center,
        // and set ctr to be the circumCircle center
        // returns 0 otherwise
        double circumCircle(point p1, point p2, point p3, point ctr) {
            double a = p2.x - p1.x, b = p2.y - p1.y;
            double c = p3.x - p1.x, d = p3.y - p1.y;
            double e = a * (p1.x + p2.x) + b * (p1.y + p2.y);
            double f = c * (p1.x + p3.x) + d * (p1.y + p3.y);
            double g = 2.0 * (a * (p3.y - p2.y) - b * (p3.x - p2.x));
            if (Math.abs(g) < EPS) return 0;

            ctr.x = (d*e - b*f) / g;
            ctr.y = (a*f - c*e) / g;
            return dist(p1, ctr); } // distance from center to 1 of the 3 points

        // returns true if point d is inside the circumCircle defined by a,b,c
        boolean inCircumCircle(point a, point b, point c, point d) {
            return ((a.x - d.x) * (b.y - d.y) * ((c.x - d.x) * (c.x - d.x) + (c.y - d.y) * (c.y - d.y)) +
                    (a.y - d.y) * ((b.x - d.x) * (b.x - d.x) + (b.y - d.y) * (b.y - d.y)) * (c.x - d.x) +
                    ((a.x - d.x) * (a.x - d.x) + (a.y - d.y) * (a.y - d.y)) * (b.x - d.x) * (c.y - d.y) -
                    ((a.x - d.x) * (a.x - d.x) + (a.y - d.y) * (a.y - d.y)) * (b.y - d.y) * (c.x - d.x) -
                    (a.y - d.y) * (b.x - d.x) * ((c.x - d.x) * (c.x - d.x) + (c.y - d.y) * (c.y - d.y)) -
                    (a.x - d.x) * ((b.x - d.x) * (b.x - d.x) + (b.y - d.y) * (b.y - d.y)) * (c.y - d.y)) > 0.0;
        }

        boolean canFormTriangle(double a, double b, double c) {
            return (a + b > c) && (a + c > b) && (b + c > a); }
    }
}