Problem: E: How To Make Stars-

story

Kitano Kisaka Gakuin 1st grade stardust bell! I like the stars of the bells! At night, I'm always secretly watching the stars on the roof of the school with my childhood friend Hanayo-chin! But unfortunately the weather today is rainy ... With this, you can't see the stars! What should I do with Hanayo?

Suzu "... Ah! Nya who came up with a good idea! Nya who makes a big planetarium where you can see various stars! Hanayo-chin! Nya who will do it right away!"

Hanayo "Well, eh, Suzu-chan, wait a minute! I don't know how to make a planetarium!"

Suzu "It's okay! You can do it if you work together!

Hanayo "Da, Darekatasukete ~!"

problem

In a polygon without self-intersection, when the number of vertices is 10 and the circumference is traced in a certain direction from any vertex, the internal angle is 30 degrees or more and 60 degrees or less, and the internal angle is 240 degrees. A "star" is defined as one in which parts with a temperature of 270 degrees or more appear alternately.

The rank of a star is determined by its area. Specifically, those with an area of ​​S_1 or more are called first-class stars, and those with an area smaller than S_ {i−1} and S_i or more are called i-class stars (i ≥ 2).

Assuming that there are n classes, n kinds of areas S_1, ..., S_n are given as a guideline for the classes, so for each k (1 ≤ k ≤ n), a star that is a k-class star is created, and a two-dimensional plane is created. Place it on top. However, the stars must not overlap each other.

Input format

The input is given in the following format.


n
S_1 ... S_n


The number n of the classes is given in the first line. On the second line, the integers S_1 to S_n, which represent the area that serves as a guide for the class, are given in order, separated by blanks.

The input satisfies the following constraints.

* 1 ≤ n ≤ 100
* 1 ≤ S_i ≤ 100,000 (1 ≤ i ≤ n)
* If i <j, then S_i> S_j



Output format

For all class stars, output the class integer k on the first line, and output the coordinates (x, y) of 10 vertices counterclockwise from any vertex on the following 10 lines line by line. .. For the coordinates of the vertices (x, y), output x and y separated by blanks. Output the stars in order from the first-class stars. That is, the output is as follows.


First-class star output
...
n-class star output


For k-class stars, the output is as follows.


k
x_1 y_1
...
x_ {10} y_ {10}


However, the absolute value of the coordinates must not exceed 5,000. Also, since the output can be very large, the output of the coordinate values ​​should be up to 9 digits after the decimal point.

For the internal angle of a star, allow an absolute error from the specified range up to 10 ^ {−3} rad (radians).

It is not permissible for stars to intersect or touch each other, or for one star to be contained in another. Here, the fact that the stars are in contact means that the distance between any two sides contained in different stars is 10 ^ {−7} or less.

The area of ​​the first-class star must be S_1 or more, and the area of ​​the i-class star (i ≥ 2) must be less than S_ {i−1} and more than S_i, but the absolute error is allowed up to 10 ^ {−7}.

The distance between any two vertices that make up a star must be greater than or equal to 10 ^ {−3}.

Input example 1


2
10 5


Output example 1


1
-10.00 -6.48
-10.79 -8.91
-13.34 -8.91
-11.28 -10.41
-12.07 -12.84
-10.00 -11.34
-7.93 -12.84
-8.72 -10.41
-6.66 -8.91
-9.21 -8.91
2
10.00 12.34
9.47 10.72
7.77 10.72
9.15 9.72
8.62 8.10
10.00 9.10
11.38 8.10
10.85 9.72
12.23 10.72
10.53 10.72


Input example 2


3
10 8 5


Output example 2


1
-10.00 -6.48
-10.79 -8.91
-13.34 -8.91
-11.28 -10.41
-12.07 -12.84
-10.00 -11.34
-7.93 -12.84
-8.72 -10.41
-6.66 -8.91
-9.21 -8.91
2
10.00 12.93
9.34 10.91
7.21 10.91
8.94 9.65
8.28 7.63
10.00 8.88
11.72 7.63
11.06 9.65
12.79 10.91
10.66 10.91
3
20.00 22.34
19.47 20.72
17.77 20.72
19.15 19.72
18.62 18.10
20.00 19.10
21.38 18.10
20.85 19.72
22.23 20.72
20.53 20.72






Example

Input

2
10 5


Output

1
-10.00 -6.48
-10.79 -8.91
-13.34 -8.91
-11.28 -10.41
-12.07 -12.84
-10.00 -11.34
-7.93 -12.84
-8.72 -10.41
-6.66 -8.91
-9.21 -8.91
2
10.00 12.34
9.47 10.72
7.77 10.72
9.15 9.72
8.62 8.10
10.00 9.10
11.38 8.10
10.85 9.72
12.23 10.72
10.53 10.72

Solution (in CPP):

Solution:
#include <iostream>
#include <cstdio>
#include <vector>
#include <complex>
#include <algorithm>
#include <cmath>
using namespace std;
typedef complex<double> P;
typedef pair<P,P> L;
typedef vector<P> Poly;
#define X real()
#define Y imag()

const double EPS = (1e-10), pi = acos(-1);
double dot(P a, P b){ return a.X*b.X - a.Y*b.Y;}
double cross(P a, P b){ return a.X*b.Y-a.Y*b.X;}

P intersection(L a, L b){
  return a.first + cross(b.second - b.first,a.first-b.first)/
    (-cross(b.second-b.first,a.second-b.first)+cross(b.second-b.first,a.first-b.first))*(a.second-a.first);
}

int ccw(P a, P b, P c){
  b -= a;
  c -= a;
  if(cross(b,c) > EPS) return 1;
  if(cross(b,c) < -EPS) return -1;
  if(dot(b,c) < -EPS) return 2;
  if(norm(c) - norm(b) > EPS) return -2;
  return 0;
}

bool is_cross(L a, L b){
  return (ccw(a.first,a.second,b.first)*ccw(a.first,a.second,b.second) < 0 &&
          ccw(b.first,b.second,a.first)*ccw(b.first,b.second,a.second) < 0);
}

bool cmp_arg(P a, P b){ return arg(a) < arg(b);}

int main(){
  int n;
  cin >> n;
  vector<double> S(n);
  for(int i = 0; i < n; ++i) cin >> S[i], S[i] += 0.5;
  Poly x;
  for(int i = 0; i < 5; ++i){
    x.push_back(polar(1.0,4.0*pi*i/5.0));
  }
  Poly star;
  for(int i = 0; i < 5; ++i){
    star.push_back(x[i]);
    for(int j = 0; j < i; ++j){
      L l1 = L(x[i],x[(i+1)%5]), l2 = L(x[j],x[(j+1)%5]);
      if(is_cross(l1,l2)){
        star.push_back(intersection(l1,l2));
      }
    }
  }
  sort(star.begin(),star.end(), cmp_arg);
  double s = 0;
  for(int i = 0; i < 10; ++i){
    s += 0.5*cross(star[i],star[(i+1)%10]);
  }
  for(int i = 0; i < n; ++i){
    double r = sqrt(S[i]/s);
    Poly t = star;
    for(int j = 0; j < 10; ++j) t[j] *= r;
    double xx = -4500, yy = -4500;
    xx += i/10*1000;
    yy += i%10*1000;
    cout << i+1 << endl;
    for(int j = 0; j < 10; ++j) printf("%.9f %.9f\n", t[j].X+xx, t[j].Y+yy);
  }
  return 0;
}