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, vx^2 + vy^2 > 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

Source: codeforces | Difficulty: HARD
Tags: Geometry


Solutions:
import math
(px, py, vx, vy, a, b, c, d) = map(int, input().split())
l = math.sqrt(vx ** 2 + vy ** 2)
(gx, gy) = (px + -1 * vx * d / l, py + -1 * vy * d / l)
pts = []
pts.append([px + b * vx / l, py + b * vy / l])
pts.append([px + -1 * (a / 2) * vy / l, py + vx * (a / 2) / l])
pts.append([px + -1 * vy * (c / 2) / l, py + vx * (c / 2) / l])
pts.append([gx + -1 * (c / 2) * vy / l, gy + vx * (c / 2) / l])
pts.append([gx + c / 2 * vy / l, gy + -1 * vx * (c / 2) / l])
pts.append([px + vy * (c / 2) / l, py + -1 * vx * (c / 2) / l])
pts.append([px + a / 2 * vy / l, py + -1 * vx * (a / 2) / l])
for x in pts:
	print(x[0], x[1])


from decimal import *
from math import sqrt
getcontext().prec = 100
(px, py, vx, vy, a, b, c, d) = list(map(Decimal, input().split()))
absv = Decimal(sqrt(vx ** 2 + vy ** 2))
n0x = vx / absv
n0y = vy / absv
(n1x, n1y) = (n0y, -n0x)
(n2x, n2y) = (-n0x, -n0y)
(n3x, n3y) = (-n0y, n0x)
print(px + b * n0x, py + b * n0y)
print(px + a * n3x / 2, py + a * n3y / 2)
p2x = px + n3x * (c / 2)
p2y = py + n3y * (c / 2)
print(p2x, p2y)
print(p2x + n2x * d, p2y + n2y * d)
p3x = px + n1x * (c / 2)
p3y = py + n1y * (c / 2)
print(p3x + n2x * d, p3y + n2y * d)
print(p3x, p3y)
print(px + a * n1x / 2, py + a * n1y / 2)


def CF630O():
	(px, py, vx, vy, a, b, c, d) = list(map(int, input().split()))
	l = (vx ** 2 + vy ** 2) ** 0.5
	vx /= l
	vy /= l
	print(px + vx * b, py + vy * b)
	print(px - vy * a / 2, py + vx * a / 2)
	print(px - vy * c / 2, py + vx * c / 2)
	print(px - vy * (c / 2) - vx * d, py + vx * (c / 2) - vy * d)
	print(px + vy * (c / 2) - vx * d, py - vx * (c / 2) - vy * d)
	print(px + vy * c / 2, py - vx * c / 2)
	print(px + vy * a / 2, py - vx * a / 2)
CF630O()


import math
s = input()
l = s.split()
px = float(l[0])
py = float(l[1])
vx = float(l[2])
vy = float(l[3])
a = float(l[4])
b = float(l[5])
c = float(l[6])
d = float(l[7])
a2 = a / 2
c2 = c / 2

def getLeft90(x, y):
	return [-y, x]

def getRight90(x, y):
	return [y, -x]

def getEndPoint(bx, by, vx, vy, l):
	vl = math.sqrt(vx * vx + vy * vy)
	ex = l * vx / vl + bx
	ey = l * vy / vl + by
	return [ex, ey]
sol = []
sol.append(getEndPoint(px, py, vx, vy, b))
vLeft = getLeft90(vx, vy)
sol.append(getEndPoint(px, py, vLeft[0], vLeft[1], a2))
p2 = getEndPoint(px, py, vLeft[0], vLeft[1], c2)
sol.append(p2)
sol.append(getEndPoint(p2[0], p2[1], -vx, -vy, d))
vRight = getRight90(vx, vy)
p5 = getEndPoint(px, py, vRight[0], vRight[1], c2)
sol.append(getEndPoint(p5[0], p5[1], -vx, -vy, d))
sol.append(p5)
sol.append(getEndPoint(px, py, vRight[0], vRight[1], a2))
for i in sol:
	print('%.9f %.9f' % (i[0], i[1]))


mas = list(map(int, input().split()))
px = mas[0]
py = mas[1]
vx = mas[2]
vy = mas[3]
a = mas[4]
b = mas[5]
c = mas[6]
d = mas[7]
s = (vx ** 2 + vy ** 2) ** 0.5
x1 = px + b * vx / s
y1 = py + b * vy / s
x2 = px - a * vy / s / 2
y2 = py + a * vx / s / 2
x3 = px - c * vy / s / 2
y3 = py + c * vx / s / 2
x4 = px + (-c * vy / 2 - d * vx) / s
y4 = py + (c * vx / 2 - d * vy) / s
x5 = px + (c * vy / 2 - d * vx) / s
y5 = py + (-c * vx / 2 - d * vy) / s
x6 = px + c * vy / s / 2
y6 = py - c * vx / s / 2
x7 = px + a * vy / s / 2
y7 = py - a * vx / s / 2
print('%.12f %.12f' % (x1, y1))
print('%.12f %.12f' % (x2, y2))
print('%.12f %.12f' % (x3, y3))
print('%.12f %.12f' % (x4, y4))
print('%.12f %.12f' % (x5, y5))
print('%.12f %.12f' % (x6, y6))
print('%.12f %.12f' % (x7, y7))


from sys import stdin
from math import sqrt
(px, py, vx, vy, a, b, c, d) = map(int, stdin.readline().split())
length = sqrt(vx * vx + vy * vy)
vx = vx / length
vy = vy / length
(vlx, vly) = (-vy, vx)
(vrx, vry) = (vy, -vx)
midcx = px + vx * -d
midcy = py + vy * -d
x = px + vx * b
y = py + vy * b
print(x, y)
x = px + vlx * a / 2
y = py + vly * a / 2
print(x, y)
x = px + vlx * c / 2
y = py + vly * c / 2
print(x, y)
x = midcx + vlx * c / 2
y = midcy + vly * c / 2
print(x, y)
x = midcx + vrx * c / 2
y = midcy + vry * c / 2
print(x, y)
x = px + vrx * c / 2
y = py + vry * c / 2
print(x, y)
x = px + vrx * a / 2
y = py + vry * a / 2
print(x, y)


from math import *
(px, py, vx, vy, a, b, c, d) = map(int, input().split())
tri_top = (0, 0 + b)
tri_right = (0 + a / 2, 0)
tri_left = (0 - a / 2, 0)
rect_top_right = (0 + c / 2, 0)
rect_top_left = (0 - c / 2, 0)
rect_bottom_right = (0 + c / 2, 0 - d)
rect_bottom_left = (0 - c / 2, 0 - d)
theta = atan2(vx, vy)

def work(pt):
	init_theta = atan2(pt[0], pt[1])
	new_theta = init_theta + theta
	rad = sqrt(pt[0] ** 2 + pt[1] ** 2)
	x = sin(new_theta) * rad + px
	y = cos(new_theta) * rad + py
	return str(x) + ' ' + str(y)
print(work(tri_top))
print(work(tri_left))
print(work(rect_top_left))
print(work(rect_bottom_left))
print(work(rect_bottom_right))
print(work(rect_top_right))
print(work(tri_right))


import math
(px, py, vx, vy, a, b, c, d) = map(int, input().split(' '))
xpct = vx / math.sqrt(vx ** 2 + vy ** 2)
ypct = vy / math.sqrt(vx ** 2 + vy ** 2)
tipx = px + b * xpct
tipy = py + b * ypct
print(tipx, tipy)
left_trianglex = px + a / 2 * -1 * ypct
left_triangley = py + a / 2 * xpct
print(left_trianglex, left_triangley)
upper_left_rectanglex = px + c / 2 * -1 * ypct
upper_left_rectangley = py + c / 2 * xpct
print(upper_left_rectanglex, upper_left_rectangley)
lower_left_rectanglex = upper_left_rectanglex + d * -1 * xpct
lower_left_rectangley = upper_left_rectangley + d * -1 * ypct
print(lower_left_rectanglex, lower_left_rectangley)
upper_right_rectanglex = px + c / 2 * ypct
upper_right_rectangley = py + c / 2 * -1 * xpct
lower_right_rectanglex = upper_right_rectanglex + d * -1 * xpct
lower_right_rectangley = upper_right_rectangley + d * -1 * ypct
print(lower_right_rectanglex, lower_right_rectangley)
print(upper_right_rectanglex, upper_right_rectangley)
right_trianglex = px + a / 2 * ypct
right_triangley = py + a / 2 * -1 * xpct
print(right_trianglex, right_triangley)


import math as ma

def mu(a, b):
	c = []
	for i in range(len(a)):
		c.append(a[i] * b)
	return c

def ad(a, b):
	c = []
	for i in range(len(a)):
		c.append(a[i] + b[i])
	return c

def per(a):
	if a[1] == 0:
		return [0, 1]
	else:
		b = ma.sqrt(1 + a[0] ** 2 / a[1] ** 2)
		return [-1 / b, a[0] / a[1] / b]
(px, py, vx, vy, a, b, c, d) = list(map(int, input().split()))
p = [px, py]
u = mu([vx, vy], 1 / ma.sqrt(vx ** 2 + vy ** 2))
ud = [-u[1], u[0]]
print(*ad(p, mu(u, b)))
print(*ad(p, mu(ud, a / 2)))
print(*ad(p, mu(ud, c / 2)))
print(*ad(ad(p, mu(ud, c / 2)), mu(u, -d)))
print(*ad(ad(p, mu(ud, -c / 2)), mu(u, -d)))
print(*ad(p, mu(ud, -c / 2)))
print(*ad(p, mu(ud, -a / 2)))


(px, py, vx, vy, a, b, c, d) = map(int, input().split())
vl = (vx ** 2 + vy ** 2) ** 0.5
vx /= vl
vy /= vl
print(px + vx * b, py + vy * b)
print(px - vy * a / 2, py + vx * a / 2)
print(px - vy * c / 2, py + vx * c / 2)
print(px - vy * c / 2 - vx * d, py + vx * c / 2 - vy * d)
print(px + vy * c / 2 - vx * d, py - vx * c / 2 - vy * d)
print(px + vy * c / 2, py - vx * c / 2)
print(px + vy * a / 2, py - vx * a / 2)


import math
ln = input().split(' ')
px = int(ln[0])
py = int(ln[1])
vx = int(ln[2])
vy = int(ln[3])
a = int(ln[4])
b = int(ln[5])
c = int(ln[6])
d = int(ln[7])
x_dir = vx / math.sqrt(vx ** 2 + vy ** 2)
y_dir = vy / math.sqrt(vx ** 2 + vy ** 2)
print(px + b * x_dir, py + b * y_dir)
print(px - a / 2 * y_dir, py + a / 2 * x_dir)
print(px - c / 2 * y_dir, py + c / 2 * x_dir)
print(px - c / 2 * y_dir - d * x_dir, py + c / 2 * x_dir - d * y_dir)
print(px + c / 2 * y_dir - d * x_dir, py - c / 2 * x_dir - d * y_dir)
print(px + c / 2 * y_dir, py - c / 2 * x_dir)
print(px + a / 2 * y_dir, py - a / 2 * x_dir)


import os, sys, pdb
import time, calendar, datetime
import math, itertools
import operator as op
from functools import reduce

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom
(px, py, vx, vy, a, b, c, d) = list(map(int, input().split()))
theta = math.atan2(vy, vx)
print(px + b * math.cos(theta), py + b * math.sin(theta))
print(px + a / 2 * math.cos(theta + math.pi / 2), py + a / 2 * math.sin(theta + math.pi / 2))
print(px + c / 2 * math.cos(theta + math.pi / 2), py + c / 2 * math.sin(theta + math.pi / 2))
print(px + c / 2 * math.cos(theta + math.pi / 2) - d * math.cos(theta), py + c / 2 * math.sin(theta + math.pi / 2) - d * math.sin(theta))
print(px + c / 2 * math.cos(theta - math.pi / 2) - d * math.cos(theta), py + c / 2 * math.sin(theta - math.pi / 2) - d * math.sin(theta))
print(px + c / 2 * math.cos(theta - math.pi / 2), py + c / 2 * math.sin(theta - math.pi / 2))
print(px + a / 2 * math.cos(theta - math.pi / 2), py + a / 2 * math.sin(theta - math.pi / 2))


import math
(px, py, vx, vy, a, b, c, d) = map(int, input().split(' '))
l = math.sqrt(vx * vx + vy * vy)
print(px + b / l * vx, py + b / l * vy)
print(px - a / 2 / l * vy, py + a / 2 / l * vx)
print(px - c / 2 / l * vy, py + c / 2 / l * vx)
print(px - c / 2 / l * vy - d / l * vx, py + c / 2 / l * vx - d / l * vy)
print(px + c / 2 / l * vy - d / l * vx, py - c / 2 / l * vx - d / l * vy)
print(px + c / 2 / l * vy, py - c / 2 / l * vx)
print(px + a / 2 / l * vy, py - a / 2 / l * vx)


import math

class Vector:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def length(self):
		return math.hypot(self.x, self.y)

	def normalize(self):
		self /= self.length()

	def normalized(self):
		return self / self.length()

	def rotateLeft(self):
		x = self.x
		y = self.y
		self.x = -y
		self.y = x

	def rotatedLeft(self):
		x = -self.y
		y = self.x
		return Vector(x, y)

	def rotateRight(self):
		x = self.x
		y = self.y
		self.x = y
		self.y = -x

	def rotatedRight(self):
		x = self.y
		y = -self.x
		return Vector(x, y)

	def __iadd__(self, other):
		self.x += other.x
		self.y += other.y
		return self

	def __isub__(self, other):
		self.x -= other.x
		self.y -= other.y
		return self

	def __add__(self, other):
		return Vector(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return Vector(self.x - other.x, self.y - other.y)

	def __imul__(self, other):
		self.x *= other
		self.y *= other
		return self

	def __itruediv__(self, other):
		self.x /= other
		self.y /= other
		return self

	def __mul__(self, other):
		return Vector(self.x * other, self.y * other)

	def __truediv__(self, other):
		return Vector(self.x / other, self.y / other)

	def __neg__(self):
		return Vector(-self.x, -self.y)

	def __str__(self):
		return str(self.x) + ' ' + str(self.y)
(px, py, vx, vy, a, b, c, d) = [int(i) for i in input().split()]
LEFT = math.pi * 0.5
RIGHT = -math.pi * 0.5
BACK = math.pi
p = Vector(px, py)
v = Vector(vx, vy)
v.normalize()
A = p + v * b
B = p + v.rotatedLeft() * (a / 2)
C = p + v.rotatedLeft() * (c / 2)
D = C + -v * d
F = p + v.rotatedRight() * (c / 2)
E = F + -v * d
G = p + v.rotatedRight() * (a / 2)
print(A)
print(B)
print(C)
print(D)
print(E)
print(F)
print(G)


class Point:
	x = 0.0
	y = 0.0

	def __init__(self, x=0, y=0):
		self.x = x
		self.y = y

	def print(self):
		print(self.x, self.y)

def add(a, b):
	return Point(a.x + b.x, a.y + b.y)

def ln(a):
	return (a.x * a.x + a.y * a.y) ** 0.5

def norm(a):
	b = a
	l = ln(a)
	b.x /= l
	b.y /= l
	return b

def mult(a, b):
	return Point(a.x * b, a.y * b)

def rot(a):
	return Point(a.y, -a.x)
p = Point()
v = Point()
(p.x, p.y, v.x, v.y, a, b, c, d) = map(float, input().split())
v = norm(v)
r1 = add(p, mult(v, b))
v = rot(v)
r7 = add(p, mult(v, a / 2))
r6 = add(p, mult(v, c / 2))
v = rot(v)
r5 = add(r6, mult(v, d))
v = rot(v)
r2 = add(p, mult(v, a / 2))
r3 = add(p, mult(v, c / 2))
v = rot(rot(rot(v)))
r4 = add(r3, mult(v, d))
r1.print()
r2.print()
r3.print()
r4.print()
r5.print()
r6.print()
r7.print()


import math

def main():
	(x, y, vx, vy, a, b, c, d) = map(int, input().split())
	len = math.sqrt(vx * vx + vy * vy)
	vx /= len
	vy /= len
	print(x + vx * b, y + vy * b)
	print(x - vy * a / 2, y + vx * a / 2)
	print(x - vy * c / 2, y + vx * c / 2)
	print(x - vy * c / 2 - vx * d, y + vx * c / 2 - vy * d)
	print(x + vy * c / 2 - vx * d, y - vx * c / 2 - vy * d)
	print(2 * x - (x - vy * c / 2), 2 * y - (y + vx * c / 2))
	print(2 * x - (x - vy * a / 2), 2 * y - (y + vx * a / 2))
main()


import math

def main():
	(x, y, vx, vy, s, a, c, d) = map(int, input().split(' '))
	l = math.sqrt(vx ** 2 + vy ** 2)
	print(x + a / l * vx, y + a / l * vy)
	print(x - s / 2 / l * vy, y + s / 2 / l * vx)
	print(x - c / 2 / l * vy, y + c / 2 / l * vx)
	print(x - c / 2 / l * vy - d / l * vx, y + c / 2 / l * vx - d / l * vy)
	print(x + c / 2 / l * vy - d / l * vx, y - c / 2 / l * vx - d / l * vy)
	print(x + c / 2 / l * vy, y - c / 2 / l * vx)
	print(x + s / 2 / l * vy, y - s / 2 / l * vx)
main()


import math
tab = [float(i) for i in input().split()]
tabx = [0, 0, 0, 0, 0, 0, 0]
taby = [0, 0, 0, 0, 0, 0, 0]
tabx[0] = tab[0] + tab[5] * tab[2] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
taby[0] = tab[1] + tab[5] * tab[3] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
tabx[1] = tab[0] - 0.5 * tab[4] * tab[3] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
taby[1] = tab[1] + 0.5 * tab[4] * tab[2] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
tabx[2] = tab[0] - 0.5 * tab[6] * tab[3] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
taby[2] = tab[1] + 0.5 * tab[6] * tab[2] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
tabx[3] = tabx[2] - tab[7] * tab[2] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
taby[3] = taby[2] - tab[7] * tab[3] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
tabx[4] = tabx[3] + tab[6] * tab[3] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
taby[4] = taby[3] - tab[6] * tab[2] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
tabx[5] = tab[0] + 0.5 * tab[6] * tab[3] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
taby[5] = tab[1] - 0.5 * tab[6] * tab[2] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
tabx[6] = tab[0] + 0.5 * tab[4] * tab[3] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
taby[6] = tab[1] - 0.5 * tab[4] * tab[2] / math.sqrt(tab[2] ** 2 + tab[3] ** 2)
for i in range(0, 7):
	print('{:10.12f}'.format(tabx[i]), ' ', '{:10.12f}'.format(taby[i]))


from math import sin, cos, atan2, sqrt, pi
(px, py, vx, vy, a, b, c, d) = [float(i) for i in input().split()]
angle = atan2(vy, vx)

def rotate(x0, y0, x, y, alpha):
	local_x = x - x0
	local_y = y - y0
	point_angle = atan2(local_y, local_x)
	length = sqrt((x - x0) ** 2.0 + (y - y0) ** 2.0)
	return (x0 + length * sin(point_angle + alpha), y0 - length * cos(point_angle + alpha))
r0 = (px, py + b)
r6 = (px + a / 2.0, py)
r5 = (px + c / 2.0, py)
r4 = (px + c / 2.0, py - d)
r3 = (px - c / 2.0, py - d)
r2 = (px - c / 2.0, py)
r1 = (px - a / 2.0, py)
points = [r0, r1, r2, r3, r4, r5, r6]
for point in points:
	new_point = rotate(px, py, point[0], point[1], angle)
	print(' '.join(map(str, new_point)))


from math import sqrt
(px, py, vx, vy, a, b, c, d) = (int(x) for x in input().split())
veclen = sqrt(vx ** 2 + vy ** 2)
newvx = b / veclen * vx
newvy = b / veclen * vy
point1x = px + newvx
point1y = py + newvy
(newvx, newvy) = (-newvy, newvx)
veclen = sqrt(newvx ** 2 + newvy ** 2)
newvx = a / 2 / veclen * newvx
newvy = a / 2 / veclen * newvy
point2x = px + newvx
point2y = py + newvy
point7x = px - newvx
point7y = py - newvy
veclen = sqrt(newvx ** 2 + newvy ** 2)
newvx = c / 2 / veclen * newvx
newvy = c / 2 / veclen * newvy
point3x = px + newvx
point3y = py + newvy
point6x = px - newvx
point6y = py - newvy
(newvx, newvy) = (-newvy, newvx)
veclen = sqrt(newvx ** 2 + newvy ** 2)
newvx = d / veclen * newvx
newvy = d / veclen * newvy
point4x = point3x + newvx
point4y = point3y + newvy
point5x = point6x + newvx
point5y = point6y + newvy
print(str(point1x) + ' ' + str(point1y))
print(str(point2x) + ' ' + str(point2y))
print(str(point3x) + ' ' + str(point3y))
print(str(point4x) + ' ' + str(point4y))
print(str(point5x) + ' ' + str(point5y))
print(str(point6x) + ' ' + str(point6y))
print(str(point7x) + ' ' + str(point7y))


l = [0] + list(map(int, input().split()))
from math import sqrt
k = l[6] / sqrt(l[3] ** 2 + l[4] ** 2)
A = (l[1] + l[3] * k, l[2] + l[4] * k)
(l[3], l[4]) = (-l[4], l[3])
k = l[5] / (2 * sqrt(l[3] ** 2 + l[4] ** 2))
B = (l[1] + l[3] * k, l[2] + l[4] * k)
k = l[7] / (2 * sqrt(l[3] ** 2 + l[4] ** 2))
C = (l[1] + l[3] * k, l[2] + l[4] * k)
F = (2 * l[1] - C[0], 2 * l[2] - C[1])
G = (2 * l[1] - B[0], 2 * l[2] - B[1])
L = [l[3], l[4]]
(l[3], l[4]) = (-l[4], l[3])
R = [-l[4], l[3]]
K = l[7] / (2 * sqrt(l[3] ** 2 + l[4] ** 2))
k = l[8] / sqrt(l[3] ** 2 + l[4] ** 2)
M = (l[1] + l[3] * k, l[2] + l[4] * k)
D = (M[0] + L[0] * K, M[1] + L[1] * K)
E = (M[0] + R[0] * K, M[1] + R[1] * K)
print(*A)
print(*B)
print(*C)
print(*D)
print(*E)
print(*F)
print(*G)


(xp, yp, vx, vy, a, b, c, d) = [int(x) for x in input().split()]
L = (vx ** 2 + vy ** 2) ** 0.5
(vx, vy) = (vx / L, vy / L)
A = [0 for i in range(7)]
A[0] = (b * vx, b * vy)
A[1] = (-a * vy / 2, a * vx / 2)
A[2] = (-c * vy / 2, c * vx / 2)
A[3] = (-c * vy / 2 - d * vx, c * vx / 2 - d * vy)
A[4] = (c * vy / 2 - d * vx, -c * vx / 2 - d * vy)
A[5] = (c * vy / 2, -c * vx / 2)
A[6] = (a * vy / 2, -a * vx / 2)
for (x, y) in A:
	print(x + xp, y + yp)


import math

def main():
	(px, py, vx, vy, a, b, c, d) = map(int, input().split())
	vectorx = vx / math.sqrt(math.pow(vx, 2) + math.pow(vy, 2))
	vectory = vy / math.sqrt(math.pow(vx, 2) + math.pow(vy, 2))
	print(px + b * vectorx, py + b * vectory)
	print(px - a / 2 * vectory, py + a / 2 * vectorx)
	print(px - c / 2 * vectory, py + c / 2 * vectorx)
	print(px - c / 2 * vectory - d * vectorx, py + c / 2 * vectorx - d * vectory)
	print(px + c / 2 * vectory - d * vectorx, py - c / 2 * vectorx - d * vectory)
	print(px + c / 2 * vectory, py - c / 2 * vectorx)
	print(px + a / 2 * vectory, py - a / 2 * vectorx)
main()


import math
from decimal import Decimal
(px, py, vx, vy, a, b, c, d) = map(Decimal, input().split())
h = (vx ** 2 + vy ** 2).sqrt()
(vx, vy) = (vx / h, vy / h)
print('%0.60f %0.60f' % (px + vx * b, py + vy * b))
print('%0.60f %0.60f' % (px - a / 2 * vy, py + a / 2 * vx))
print('%0.60f %0.60f' % (px - c / 2 * vy, py + c / 2 * vx))
print('%0.60f %0.60f' % (px - c / 2 * vy - d * vx, py + c / 2 * vx - d * vy))
print('%0.60f %0.60f' % (px + c / 2 * vy - d * vx, py - c / 2 * vx - d * vy))
print('%0.60f %0.60f' % (px + c / 2 * vy, py - c / 2 * vx))
print('%0.60f %0.60f' % (px + a / 2 * vy, py - a / 2 * vx))


from math import atan2, pi
EPS = 1e-08

def eq(a, b):
	return abs(a - b) < EPS

class Vector:

	def __init__(self, x2, y2, x1=0, y1=0):
		self.x = x2 - x1
		self.y = y2 - y1
		self.s = (self.x ** 2 + self.y ** 2) ** 0.5

	def __add__(self, other):
		return Vector(self.x + other.x, self.y + other.y)

	def __sub__(self, other):
		return Vector(self.x - other.x, self.y - other.y)

	def mul_k(self, k):
		self.x *= k
		self.y *= k

	def mul_kk(self, k):
		return Vector(self.x * k, self.y * k)

	def rotate(self):
		return Vector(-self.y, self.x)

	def rotate2(self):
		return self.rotate().rotate().rotate()

	def reverseee(self):
		return Vector(-self.x, -self.y)

	def __mul__(self, other):
		return self.x * other.x + self.y * other.y

	def vectormul(self, other):
		return self.x * other.y - self.y * other.x

	def get_angle(self, other):
		return atan2(self.vectormul(other), self * other)

	def norm(self):
		if self.s == 0:
			return Vector(self.x, self.y)
		return Vector(self.x / self.s, self.y / self.s)

	def __str__(self):
		return f'{self.x} {self.y}'

	def middle(self, point):
		return Vector((self.x + point.x) / 2, (self.y + point.y) / 2)

class Line:

	def __init__(self, point=None, vector=None, point2=None, a=None, b=None, c=None):
		if a is not None:
			self.v = Vector(a, b).rotate()
			self.p = Vector(a, b)
			self.p.mul_k(-c / (a ** 2 + b ** 2))
			self.A = a
			self.B = b
			self.C = c
			return
		if vector is None:
			vector = point2 - point
		self.p = point
		self.v = vector
		self.A = self.v.y
		self.B = -self.v.x
		self.C = -self.A * self.p.x - self.p.y * self.B

	def get_abc(self):
		return (self.A, self.B, self.C)

	def __str__(self):
		return str(self.A) + ' ' + str(self.B) + ' ' + str(self.C)

	def check(self, point):
		return eq(-point.x * self.A - self.B * point.y, self.C)

	def get_s_from_point(self, point):
		v = self.v.norm()
		v2 = point - self.p
		a = v * v2
		v.mul_k(a)
		v3 = v + self.p
		s = v3 - point
		return s.s

	def get_bisect(self, line):
		return Line(point=self.get_peresech(line)[1], vector=self.v.norm() + line.v.norm())

	def get_proection(self, point):
		v = self.v.norm()
		v2 = point - self.p
		a = v * v2
		v.mul_k(a)
		v3 = v + self.p
		return v3

	def get_paral_line(self, le):
		v = self.v.norm().rotate()
		v.mul_k(le)
		return Line(point=self.p + v, vector=self.v)

	def get_peresech(self, lin):
		u = lin.v.rotate()
		a = self.v * u
		if eq(a, 0):
			if eq(self.get_s_from_point(lin.p), 0):
				return (2,)
			return (0,)
		t = (lin.p - self.p) * u / (self.v * u)
		v = Vector(self.v.x, self.v.y)
		v.mul_k(t)
		return (1, self.p + v)

	def get_mirror(self, point):
		v = self.v.norm()
		v2 = point - self.p
		a = v * v2
		v.mul_k(a)
		v3 = v + self.p
		s = v3 - point
		return s + v3

def is_on_line(v1, v2):
	return eq(v1.vectormul(v2), 0)

def is_on_luch(v1, v2):
	return eq(v1.get_angle(v2), 0)

def is_on_otr(v1, v2, v3, v4):
	return eq(v1.get_angle(v2), 0) and eq(v3.get_angle(v4), 0)

def get_s_from_luch(xp, yp, x1, y1, x2, y2):
	v = Vector(x2, y2, x1, y1).norm()
	v2 = Vector(xp, yp, x1, y1)
	a = v * v2
	v1 = Vector(x2, y2, x1, y1)
	v.mul_k(a)
	v3 = v + Vector(x1, y1)
	(xh, yh) = (v3.x, v3.y)
	v4 = Vector(xh, yh, x1, y1)
	b = v1.get_angle(v4)
	if eq(b, 0):
		se = v3 - Vector(xp, yp)
		return se.s
	else:
		return (Vector(x1, y1) - Vector(xp, yp)).s

def get_s_from_otr(xp, yp, x1, y1, x2, y2):
	return max(get_s_from_luch(xp, yp, x1, y1, x2, y2), get_s_from_luch(xp, yp, x2, y2, x1, y1))

def get_s_from_line(xp, yp, x1, y1, x2, y2):
	v = Vector(x2, y2, x1, y1).norm()
	v2 = Vector(xp, yp, x1, y1)
	a = v * v2
	return a

def peresec_otr(x1, y1, x2, y2, x3, y3, x4, y4):
	AB = Vector(x2, y2, x1, y1)
	CD = Vector(x4, y4, x3, y3)
	AC = Vector(x3, y3, x1, y1)
	AD = Vector(x4, y4, x1, y1)
	CA = Vector(x1, y1, x3, y3)
	CB = Vector(x2, y2, x3, y3)
	yg1 = AB.get_angle(AD)
	yg2 = AB.get_angle(AC)
	yg3 = CD.get_angle(CA)
	yg4 = CD.get_angle(CB)
	flag = False
	if yg1 < 0 and yg2 < 0 or (yg1 > 0 and yg2 > 0):
		flag = True
	if yg3 < 0 and yg4 < 0 or (yg3 > 0 and yg4 > 0):
		flag = True
	if max(min(x1, x2), min(x3, x4)) > min(max(x1, x2), max(x3, x4)):
		flag = True
	if max(min(y1, y2), min(y3, y4)) > min(max(y1, y2), max(y3, y4)):
		flag = True
	return not flag

def get_s_from_otr_to_otr(x1, y1, x2, y2, x3, y3, x4, y4):
	if peresec_otr(x1, y1, x2, y2, x3, y3, x4, y4):
		return 0
	return min(get_s_from_otr(x1, y1, x3, y3, x4, y4), get_s_from_otr(x2, y2, x3, y3, x4, y4), get_s_from_otr(x3, y3, x1, y1, x2, y2), get_s_from_otr(x4, y4, x1, y1, x2, y2))

def main():
	(px, py, vx, vy, a, b, c, d) = map(int, input().split())
	P = Vector(px, py)
	V = Vector(vx, vy).norm()
	A = V.mul_kk(b) + P
	B = V.mul_kk(a / 2).rotate() + P
	C = V.mul_kk(c / 2).rotate() + P
	D = C + V.rotate().rotate().mul_kk(d)
	E = D + V.rotate2().mul_kk(c)
	F = P + V.rotate2().mul_kk(c / 2)
	G = P + V.rotate2().mul_kk(a / 2)
	print(A, B, C, D, E, F, G, sep='\n')
main()


(px, py, vx, vy, a, b, c, d) = map(int, input().split())
v = (vx ** 2 + vy ** 2) ** 0.5
print('{} {}'.format(px + vx / v * b, py + vy / v * b))
print('{} {}'.format(px - vy / v * a / 2, py + vx / v * a / 2))
print('{} {}'.format(px - vy / v * c / 2, py + vx / v * c / 2))
print('{} {}'.format(px - vy / v * c / 2 - vx / v * d, py + vx / v * c / 2 - vy / v * d))
print('{} {}'.format(px + vy / v * c / 2 - vx / v * d, py - vx / v * c / 2 - vy / v * d))
print('{} {}'.format(px + vy / v * c / 2, py - vx / v * c / 2))
print('{} {}'.format(px + vy / v * a / 2, py - vx / v * a / 2))