ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

1046. Geometrical Dreams

Time limit: 0.5 second
Memory limit: 64 MB
There is a polygon A1A2AN (the vertices Ai are numbered in clockwise order). On each side AiAi+1 an isosceles triangle AiMiAi+1 is built on the outer side of the polygon (MiAi = MiAi+1). The angle AiMiAi+1 is equal to αi. Here we assume that AN+1 = A1.
The set of angles αi satisfies a condition that the sum of angles in any of its nonempty subsets is not aliquot to 360 degrees.
You are given N, coordinates of vertices Mi and angles αi (measured in degrees). Write a program, which restores coordinates of the polygon vertices.

Input

The first line contains an integer N (3 ≤ N ≤ 50). The next N lines contain pairs of real numbers xi, yi which are coordinates of points Mi (–100 ≤ xi, yi ≤ 100). And the last N lines of the input consist of degree values of angles αi. All real numbers in the input contain at most 2 digits after decimal point.

Output

Output N lines with points coordinates, i-th line should contain the coordinates of Ai. Coordinates must be accurate to 2 digits after decimal point. You may assume that solution always exists.

Sample

inputoutput
3
0 2
3 3
2 0
90
90
90
1 1
1 3
3 1
Problem Author: Dmitry Filimonenkov
Problem Source: Ural State University collegiate programming contest (25.03.2000)