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 <cstdio>
#include <vector>
#include <iostream>
#include <complex>
#include <cmath>
using namespace std;

using P = complex<double>;

double cross(const P& a, const P& b){
  return a.real()*b.imag() - a.imag()*b.real();
}

double area(const vector<P>& pol){
  int n = pol.size();
  double ret = 0;
  for(int i = 0; i < n; ++i){
    ret += cross(pol[i],pol[(i+1)%n]);
  }
  ret *= 0.5;
  return ret;
}

int main(){
  int n;
  cin >> n;
  vector<P> star = {P(-10.00, -6.48),
                    P(-10.79, -8.91),
                    P(-13.34, -8.91),
                    P(-11.28, -10.41),
                    P(-12.07, -12.84),
                    P(-10.00, -11.34),
                    P(-7.93, -12.84),
                    P(-8.72, -10.41),
                    P(-6.66, -8.91),
                    P(-9.21, -8.91)};
  // for(auto p : star)
  //   cerr << p << endl;

  double r = sqrt(area(star));
  // cerr << r << endl;
  P g(0,0);
  for(auto& p : star){
    p /= r;
    g += p;
  }
  g /= 10;
  for(auto& p : star)
    p -= g;
  double Xmin = -5e3, Ymin = -5e3;
  for(int i = 0; i < n; ++i){
    P c(Xmin + 500 + (i/10)*1e3, Ymin + 500 + (i%10)*1e3);
    double a;
    cin >> a;
    a += 1e-2;
    double rr = sqrt(a);
    vector<P> star_ = star;
    for(auto& p : star_){
      p *= rr;
      p += c;
    }
    printf("%d\n",i+1);
    // printf("%.9f %.9f\n",c.real(),c.imag());
    for(auto p : star_)
      printf("%.9lf %9lf\n",p.real(),p.imag());
  }
}