Problem: You are given a piece of paper in the shape of a simple polygon S. Your task is to turn it into a simple polygon T that has the same area as S.

You can use two tools: scissors and tape. Scissors can be used to cut any polygon into smaller polygonal pieces. Tape can be used to combine smaller pieces into larger polygons. You can use each tool multiple times, in any order. 

The polygons given in the input have integer coordinates, but you are allowed to produce shapes with non-integer coordinates in your output.

A formal definition of the task follows.

A shape Q=(Q_0,...,Q_{n-1}) is a sequence of three or more points in the plane such that: 

  * The closed polyline Q_0Q_1Q_2... Q_{n-1}Q_0 never touches or intersects itself, and therefore it forms the boundary of a simple polygon. 
  * The polyline goes around the boundary of the polygon in the counter-clockwise direction. 



The polygon whose boundary is the shape Q will be denoted P(Q).

Two shapes are called equivalent if one can be translated and/or rotated to become identical with the other.

Note that mirroring a shape is not allowed. Also note that the order of points matters: the shape (Q_1,...,Q_{n-1},Q_0) is not necessarily equivalent to the shape (Q_0,...,Q_{n-1}).

<image>

In the figure on the left: Shapes U and V are equivalent. Shape W is not equivalent with them because the points of W are given in a different order. Regardless of the order of points, the fourth shape is not equivalent with the previous ones either as flipping a shape is not allowed.

In both input and output, a shape with n points is represented as a single line that contains 2n+1 space-separated numbers: the number n followed by the coordinates of the points: Q_{0,x}, Q_{0,y}, Q_{1,x}, ...

Shapes have identification numbers (IDs). The given shape S has ID 0, the shapes you produce in your solutions are given IDs 1, 2, 3, ..., in the order in which they are produced.

Shapes B_1,...,B_k form a subdivision of shape A if: 

  * The union of all P(B_i) is exactly P(A). 
  * For each i≠ j, the area of the intersection of P(B_i) and P(B_j) is zero. 



The scissors operation destroys one existing shape A and produces one or more shapes B_1,...,B_k that form a subdivision of A.

<image>

In the figure: Shape A (square) subdivided into shapes B_1, B_2, B_3 (the three triangles). One valid way to describe one of the B_i is "3 3 1 6 1 5.1 4".

The tape operation destroys one or more existing shapes A_1,...,A_k and produces one new shape B. In order to perform this operation, you must first specify shapes C_1,...,C_k and only then the final shape B. These shapes must satisfy the following: 

  * For each i, the shape C_i is equivalent to the shape A_i. 
  * The shapes C_1,...,C_k form a subdivision of the shape B. 



Informally, you choose the shape B and show how to move each of the existing A_i to its correct location C_i within B. Note that only the shape B gets a new ID, the shapes C_i do not.

Input

The first line contains the source shape S.

The second line contains the target shape T.

Each shape has between 3 and 10 points, inclusive. Both shapes are given in the format specified above.

All coordinates in the input are integers between -10^6 and 10^6, inclusive.

In each shape, no three points form an angle smaller than 3 degrees. (This includes non-consecutive points and implies that no three points are collinear.)

The polygons P(S) and P(T) have the same area.

Output

Whenever you use the scissors operation, output a block of lines of the form: 
    
    
      
    scissors  
    id(A) k  
    B_1  
    B_2  
    ...  
    B_k  
    

where id(A) is the ID of the shape you want to destroy, k is the number of new shapes you want to produce, and B_1,...,B_k are those shapes.

Whenever you use the tape operation, output a block of lines of the form: 
    
    
      
    tape  
    k id(A_1) ... id(A_k)  
    C_1  
    C_2  
    ...  
    C_k  
    B  
    

where k is the number of shapes you want to tape together, id(A_1),...,id(A_k) are their IDs, C_1,...,C_k are equivalent shapes showing their position within B, and B is the final shape obtained by taping them together.

It is recommended to output coordinates of points to at least 10 decimal places.

The output must satisfy the following: 

  * All coordinates of points in the output must be between -10^7 and 10^7, inclusive. 
  * Each shape in the output must have at most 100 points. 
  * In each operation the number k of shapes must be between 1 and 100, inclusive. 
  * The number of operations must not exceed 2000. 
  * The total number of points in all shapes in the output must not exceed 20000. 
  * In the end, there must be exactly one shape (that hasn't been destroyed), and that shape must be equivalent to T. 
  * All operations must be valid according to the checker. Solutions with small rounding errors will be accepted. (Internally, all comparisons check for absolute or relative error up to 10^{-3} when verifying each condition.) 

Scoring

A shape is called a nice rectangle if it has the form ((0,0),~ (x,0),~ (x,y),~ (0,y)) for some positive integers x and y.

A shape is called a nice square if additionally x=y.

A shape A is called strictly convex if all inner angles of the polygon P(A) are smaller than 180 degrees.

Subtask 1 (5 points): S and T are nice rectangles. All coordinates of all points are integers between 0 and 10, inclusive

Subtask 2 (13 points): S is a nice rectangle with x>y, and T is a nice square

Subtask 3 (12 points): S and T are nice rectangles

Subtask 4 (14 points): S is a triangle and T is a nice square

Subtask 5 (10 points): S and T are triangles

Subtask 6 (16 points): S is a strictly convex polygon and T is a nice rectangle

Subtask 7 (11 points): T is a nice rectangle

Subtask 8 (19 points): no additional constraints

Examples

Input


6 0 0 6 0 6 4 5 4 5 9 0 9
4 0 0 7 0 7 7 0 7


Output


scissors
0 5
3 0 0 3 0 3 4
3 3 4 0 4 0 0
3 3 0 6 0 6 4
3 6 4 3 4 3 0
4 0 4 5 4 5 9 0 9
tape
5 1 2 5 3 4
3 0 3 0 0 4 0
3 4 0 7 0 7 4
4 0 3 4 0 7 4 3 7
3 7 4 7 7 3 7
3 3 7 0 7 0 3
4 0 0 7 0 7 7 0 7

Input


4 0 0 3 0 3 3 0 3
4 7 -1 10 -1 11 2 8 2


Output


scissors
0 2
3 0 0 1 3 0 3
4 1 3 0 0 3 0 3 3
tape
2 1 2
3 110 -1 111 2 110 2
4 108 2 107 -1 110 -1 110 2
4 107 -1 110 -1 111 2 108 2


Input


4 0 0 9 0 9 1 0 1
4 0 0 3 0 3 3 0 3


Output


scissors
0 2
4 1.470000000 0 9 0 9 1 1.470000000 1
4 0 0 1.470000000 0 1.470000000 1 0 1
scissors
1 2
4 1.470000000 0 6 0 6 1 1.470000000 1
4 9 0 9 1 6 1 6 0
tape
2 4 3
4 3 2 3 1 6 1 6 2
4 6 1 1.470000000 1 1.470000000 0 6 0
6 1.470000000 0 6 0 6 2 3 2 3 1 1.470000000 1
scissors
5 4
4 1.470000000 0 3 0 3 1 1.470000000 1
4 3 0 4 0 4 2 3 2
4 4 2 4 0 5 0 5 2
4 5 0 6 0 6 2 5 2
tape
5 2 6 7 8 9
4 0 0 1.470000000 0 1.470000000 1 0 1
4 1.470000000 0 3 0 3 1 1.470000000 1
4 0 2 0 1 2 1 2 2
4 0 2 2 2 2 3 0 3
4 3 3 2 3 2 1 3 1
4 0 0 3 0 3 3 0 3

Note

The figure below shows the first example output. On the left is the original figure after using the scissors, on the right are the corresponding C_i when we tape those pieces back together.

<image>

In the second example output, note that it is sufficient if the final shape is equivalent to the target one, they do not have to be identical.

The figure below shows three stages of the third example output. First, we cut the input rectangle into two smaller rectangles, then we cut the bigger of those two rectangles into two more. State after these cuts is shown in the top left part of the figure.

Continuing, we tape the two new rectangles together to form a six-sided polygon, and then we cut that polygon into three 2-by-1 rectangles and one smaller rectangle. This is shown in the bottom left part of the figure.

Finally, we take the rectangle we still have from the first step and the four new rectangles and we assemble them into the desired 3-by-3 square.

<image>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-6;
int mod(int a, int m) { return (a % m + m) % m; }
bool isZero(long double x) { return abs(x) < EPS; }
int sgn(long double x) { return isZero(x) ? 0 : x < 0 ? -1 : 1; }
long double pw(long double x) { return x * x; }
long double normpw(pair<long double, long double> v) {
  return pw(v.first) + pw(v.second);
}
long double norm(pair<long double, long double> v) { return sqrt(normpw(v)); }
bool operator==(pair<long double, long double> a,
                pair<long double, long double> b) {
  return isZero(a.first - b.first) && isZero(a.second - b.second);
}
bool operator!=(pair<long double, long double> a,
                pair<long double, long double> b) {
  return !isZero(a.first - b.first) || !isZero(a.second - b.second);
}
pair<long double, long double> operator+(pair<long double, long double> a,
                                         pair<long double, long double> b) {
  return {a.first + b.first, a.second + b.second};
}
pair<long double, long double> operator-(pair<long double, long double> a,
                                         pair<long double, long double> b) {
  return {a.first - b.first, a.second - b.second};
}
pair<long double, long double> operator*(pair<long double, long double> a,
                                         long double b) {
  return {a.first * b, a.second * b};
}
pair<long double, long double> operator*(long double a,
                                         pair<long double, long double> b) {
  return {b.first * a, b.second * a};
}
long double operator/(pair<long double, long double> a,
                      pair<long double, long double> b) {
  return a.first * b.first + a.second * b.second;
}
long double operator*(pair<long double, long double> a,
                      pair<long double, long double> b) {
  return a.first * b.second - b.first * a.second;
}
long double ccw(pair<long double, long double> a,
                pair<long double, long double> b,
                pair<long double, long double> c) {
  return a * b + b * c + c * a;
}
bool isBet(long double a, long double b, long double c) {
  return (a <= b && b <= c) || (a >= b && b >= c);
}
bool isBet(pair<long double, long double> a, pair<long double, long double> b,
           pair<long double, long double> c) {
  return isBet(a.first, b.first, c.first) &&
         isBet(a.second, b.second, c.second);
}
bool isCross(pair<long double, long double> a, pair<long double, long double> b,
             pair<long double, long double> c,
             pair<long double, long double> d) {
  return sgn(ccw(a, b, c)) * sgn(ccw(a, b, d)) < 0 &&
         sgn(ccw(c, d, a)) * sgn(ccw(c, d, b)) < 0;
}
long double getAngle(pair<long double, long double> a,
                     pair<long double, long double> b,
                     pair<long double, long double> c) {
  pair<long double, long double> u = a - b, v = c - b;
  return atan2(-(u * v), u / v);
}
pair<long double, long double> getSec(pair<long double, long double> x1,
                                      pair<long double, long double> d1,
                                      pair<long double, long double> x2,
                                      pair<long double, long double> d2) {
  return ((x1 - x2) * d1 / (d2 * d1)) * d2 + x2;
}
pair<long double, long double> proj(pair<long double, long double> d,
                                    pair<long double, long double> v) {
  return d / v / normpw(d) * d;
}
pair<long double, long double> perp(pair<long double, long double> x,
                                    pair<long double, long double> d,
                                    pair<long double, long double> p) {
  return x + proj(d, p - x);
}
struct POLY {
  vector<pair<long double, long double>> V;
  int idx;
  int size() const { return ((int)(V).size()); }
  pair<long double, long double> &operator[](const int i) {
    return V[mod(i, ((int)(V).size()))];
  }
  void emplace_back(long double x, long double y) { V.emplace_back(x, y); }
  void emplace_back(pair<long double, long double> v) { V.emplace_back(v); }
  long double getArea() const {
    long double ret = 0;
    for (int i = 0, n = ((int)(V).size()); i < n; i++)
      ret += V[i] * V[(i + 1) % n];
    return abs(ret) / 2;
  }
  void prt() const {
    printf("%d", ((int)(V).size()));
    for (auto &v : V)
      printf(" %.20lf %.20lf", double(v.first), double(v.second));
    puts("");
  }
};
bool isCross(POLY &poly, pair<long double, long double> a,
             pair<long double, long double> b) {
  int n = ((int)(poly).size());
  for (int i = 0; i < n; i++) {
    if (isCross(a, b, poly[i], poly[(i + 1) % n])) return true;
    if (a != poly[i] && b != poly[i] && !sgn(ccw(a, b, poly[i])) &&
        isBet(a, poly[i], b))
      return true;
  }
  return false;
}
struct INFO {
  vector<POLY> PV;
  vector<pair<int, vector<POLY>>> EV;
  int cnt;
  void prt() {
    for (auto &ev : EV) {
      auto &V = ev.second;
      int n = ((int)(V).size()) - 1;
      if (!ev.first) {
        puts("scissors");
        printf("%d %d\n", V[0].idx, n);
        for (int i = 1; i <= n; i++) V[i].prt();
      } else {
        puts("tape");
        printf("%d", n);
        for (int i = 0; i < n; i++) printf(" %d", V[i].idx);
        puts("");
        for (int i = 0; i < n; i++) V[i].prt();
        V.back().prt();
      }
    }
  }
};
void mergeInfo(INFO &startInfo, INFO &endInfo) {
  vector<int> IMP(((int)(endInfo.PV).size()), -1);
  IMP[endInfo.PV.back().idx] = startInfo.PV.back().idx;
  for (int evi = ((int)(endInfo.EV).size()); evi--;) {
    auto PV = endInfo.EV[evi].second;
    if (!endInfo.EV[evi].first) {
      POLY finalPoly = PV[0];
      PV.erase(PV.begin());
      int fidx = startInfo.cnt++;
      IMP[finalPoly.idx] = fidx;
      finalPoly.idx = fidx;
      startInfo.PV.emplace_back(finalPoly);
      for (auto &poly : PV) poly.idx = IMP[poly.idx];
      PV.emplace_back(finalPoly);
      startInfo.EV.emplace_back(1, PV);
    } else {
      POLY initPoly = PV.back();
      PV.pop_back();
      vector<POLY> _PV;
      for (auto &poly : PV) {
        int pidx = startInfo.cnt++;
        IMP[poly.idx] = pidx;
        POLY _poly = poly;
        _poly.idx = pidx;
        startInfo.PV.emplace_back(_poly);
        _PV.emplace_back(_poly);
      }
      POLY _initPoly = initPoly;
      _initPoly.idx = IMP[initPoly.idx];
      _PV.insert(_PV.begin(), _initPoly);
      startInfo.EV.emplace_back(0, _PV);
      for (auto &poly : PV) {
        POLY _poly = poly;
        _poly.idx = IMP[poly.idx];
        POLY _oriPoly = endInfo.PV[poly.idx];
        int pidx = startInfo.cnt++;
        _oriPoly.idx = pidx;
        _poly.V = _oriPoly.V;
        startInfo.PV.emplace_back(_oriPoly);
        startInfo.EV.emplace_back(1, vector<POLY>({_poly, _oriPoly}));
        IMP[poly.idx] = pidx;
      }
    }
  }
}
void triangulation(INFO &info, POLY poly, vector<POLY> &V) {
  int n = ((int)(poly).size());
  if (3 == n) {
    V.emplace_back(poly);
    return;
  }
  POLY _poly = poly;
  for (; 3 < n;) {
    int i = 0;
    for (; ccw(poly[i - 1], poly[i], poly[i + 1]) <= 0 ||
           isCross(poly, poly[i - 1], poly[i + 1]) ||
           (ccw(poly[i - 1], poly[i + 1], poly[i - 2]) < 0 &&
            ccw(poly[i - 1], poly[i], poly[i - 2]) > 0);
         i++)
      ;
    POLY tri;
    tri.idx = info.cnt++;
    tri.emplace_back(poly[i - 1]);
    tri.emplace_back(poly[i]);
    tri.emplace_back(poly[i + 1]);
    V.emplace_back(tri);
    info.PV.emplace_back(tri);
    poly.V.erase(poly.V.begin() + i);
    n--;
  }
  poly.idx = info.cnt++;
  V.emplace_back(poly);
  info.PV.emplace_back(poly);
  vector<POLY> PV;
  PV.emplace_back(_poly);
  for (auto &v : V) PV.emplace_back(v);
  info.EV.emplace_back(0, PV);
}
void triToRect(INFO &info, POLY tri, POLY &rect) {
  vector<long double> AV;
  for (int i = 0; i < 3; i++)
    AV.emplace_back(getAngle(tri[i - 1], tri[i], tri[i + 1]));
  int i = int(max_element(((AV).begin()), ((AV).end())) - AV.begin());
  pair<long double, long double> m1 = (tri[i] + tri[i + 1]) * 0.5,
                                 m2 = (tri[i] + tri[i - 1]) * 0.5;
  pair<long double, long double> p = perp(m1, m2 - m1, tri[i]);
  POLY poly1, poly2, poly3;
  poly1.idx = info.cnt++;
  poly1.emplace_back(tri[i]);
  poly1.emplace_back(m1);
  poly1.emplace_back(p);
  info.PV.emplace_back(poly1);
  poly2.idx = info.cnt++;
  poly2.emplace_back(tri[i]);
  poly2.emplace_back(p);
  poly2.emplace_back(m2);
  info.PV.emplace_back(poly2);
  poly3.idx = info.cnt++;
  poly3.emplace_back(tri[i + 1]);
  poly3.emplace_back(tri[i - 1]);
  poly3.emplace_back(m2);
  poly3.emplace_back(m1);
  info.PV.emplace_back(poly3);
  info.EV.emplace_back(0, vector<POLY>({tri, poly1, poly2, poly3}));
  long double w = norm(tri[i - 1] - tri[i + 1]), h = norm(tri[i] - p);
  poly1[0] = {0, 0};
  poly1[1] = {norm(p - m1), h};
  poly1[2] = {0, h};
  poly2[0] = {w, 0};
  poly2[1] = {w, h};
  poly2[2] = {w - norm(p - m2), h};
  poly3[0] = {0, 0};
  poly3[1] = {w, 0};
  poly3[2] = {w - norm(p - m2), h};
  poly3[3] = {norm(p - m1), h};
  rect.idx = info.cnt++;
  rect.emplace_back(0, 0);
  rect.emplace_back(w, 0);
  rect.emplace_back(w, h);
  rect.emplace_back(0, h);
  info.PV.emplace_back(rect);
  info.EV.emplace_back(1, vector<POLY>({poly1, poly2, poly3, rect}));
}
void rectToRatioTwo(INFO &info, POLY &rect) {
  long double h, w;
  tie(w, h) = rect[2];
  for (;;) {
    if (h * 2 < w) {
      POLY poly1, poly2;
      poly1.idx = info.cnt++;
      poly1.emplace_back(0, 0);
      poly1.emplace_back(w / 2, 0);
      poly1.emplace_back(w / 2, h);
      poly1.emplace_back(0, h);
      poly2.idx = info.cnt++;
      poly2.emplace_back(w / 2, 0);
      poly2.emplace_back(w, 0);
      poly2.emplace_back(w, h);
      poly2.emplace_back(w / 2, h);
      info.PV.emplace_back(poly1);
      info.PV.emplace_back(poly2);
      info.EV.emplace_back(0, vector<POLY>({rect, poly1, poly2}));
      poly2[0] = {0, h};
      poly2[1] = {w / 2, h};
      poly2[2] = {w / 2, h * 2};
      poly2[3] = {0, h * 2};
      rect.idx = info.cnt++;
      rect[1] = {w / 2, 0};
      rect[2] = {w / 2, h * 2};
      rect[3] = {0, h * 2};
      info.PV.emplace_back(rect);
      info.EV.emplace_back(1, vector<POLY>({poly1, poly2, rect}));
      w /= 2;
      h *= 2;
    } else if (w * 2 < h) {
      POLY poly1, poly2;
      poly1.idx = info.cnt++;
      poly1.emplace_back(0, 0);
      poly1.emplace_back(w, 0);
      poly1.emplace_back(w, h / 2);
      poly1.emplace_back(0, h / 2);
      poly2.idx = info.cnt++;
      poly2.emplace_back(0, h / 2);
      poly2.emplace_back(w, h / 2);
      poly2.emplace_back(w, h);
      poly2.emplace_back(0, h);
      info.PV.emplace_back(poly1);
      info.PV.emplace_back(poly2);
      info.EV.emplace_back(0, vector<POLY>({rect, poly1, poly2}));
      poly2[0] = {w, 0};
      poly2[1] = {w * 2, 0};
      poly2[2] = {w * 2, h / 2};
      poly2[3] = {w, h / 2};
      rect.idx = info.cnt++;
      rect[1] = {w * 2, 0};
      rect[2] = {w * 2, h / 2};
      rect[3] = {0, h / 2};
      info.PV.emplace_back(rect);
      info.EV.emplace_back(1, vector<POLY>({poly1, poly2, rect}));
      w *= 2;
      h /= 2;
    } else
      break;
  }
}
void ratioTwoToSquare(INFO &info, POLY &rect) {
  long double h, w;
  tie(w, h) = rect[2];
  long double l = sqrt(w * h);
  if (isZero(w - h)) return;
  if (h <= w) {
    long double x = l - h, y = sqrt(w / h) * x;
    POLY poly1, poly2, poly3;
    poly1.idx = info.cnt++;
    poly1.emplace_back(w - y, 0);
    poly1.emplace_back(w, 0);
    poly1.emplace_back(w - y, x);
    poly2.idx = info.cnt++;
    poly2.emplace_back(w, 0);
    poly2.emplace_back(w, h);
    poly2.emplace_back(w - l, h);
    poly3.idx = info.cnt++;
    poly3.emplace_back(0, 0);
    poly3.emplace_back(w - y, 0);
    poly3.emplace_back(w - y, x);
    poly3.emplace_back(w - l, h);
    poly3.emplace_back(0, h);
    info.PV.emplace_back(poly1);
    info.PV.emplace_back(poly2);
    info.PV.emplace_back(poly3);
    info.EV.emplace_back(0, vector<POLY>({rect, poly1, poly2, poly3}));
    poly1[0] = {0, l - x};
    poly1[1] = {y, l - x};
    poly1[2] = {0, l};
    poly2[0] = {l, x};
    poly2[1] = {l, l};
    poly2[2] = {0, l};
    rect.idx = info.cnt++;
    rect[1] = {l, 0};
    rect[2] = {l, l};
    rect[3] = {0, l};
    info.PV.emplace_back(rect);
    info.EV.emplace_back(1, vector<POLY>({poly1, poly2, poly3, rect}));
  } else {
    long double x = h - l, y = l - w;
    POLY poly1, poly2, poly3;
    poly1.idx = info.cnt++;
    poly1.emplace_back(0, h - x);
    poly1.emplace_back(y, h - x);
    poly1.emplace_back(0, h);
    poly2.idx = info.cnt++;
    poly2.emplace_back(w, x);
    poly2.emplace_back(w, h);
    poly2.emplace_back(0, h);
    poly3.idx = info.cnt++;
    poly3.emplace_back(0, 0);
    poly3.emplace_back(w, 0);
    poly3.emplace_back(w, x);
    poly3.emplace_back(y, h - x);
    poly3.emplace_back(0, h - x);
    info.PV.emplace_back(poly1);
    info.PV.emplace_back(poly2);
    info.PV.emplace_back(poly3);
    info.EV.emplace_back(0, vector<POLY>({rect, poly1, poly2, poly3}));
    poly1[0] = {l - y, 0};
    poly1[1] = {l, 0};
    poly1[2] = {l - y, x};
    poly2[0] = {l, 0};
    poly2[1] = {l, l};
    poly2[2] = {l - w, l};
    rect.idx = info.cnt++;
    rect[1] = {l, 0};
    rect[2] = {l, l};
    rect[3] = {0, l};
    info.PV.emplace_back(rect);
    info.EV.emplace_back(1, vector<POLY>({poly1, poly2, poly3, rect}));
  }
}
void squareToFixedH(INFO &info, POLY &rect, long double t) {
  long double l = rect[1].first;
  long double h = t, w = l * l / t;
  int runcnt1 = 0, runcnt2 = 0;
  for (;;) {
    if (h * 2 < w) {
      h *= 2;
      w /= 2;
      runcnt1++;
    } else if (w * 2 < h) {
      w *= 2;
      h /= 2;
      runcnt2++;
    } else
      break;
  }
  if (h <= w) {
    long double x = l - h, y = sqrt(w / h) * x;
    POLY poly1, poly2, poly3;
    if (!isZero(l - h)) {
      poly1.idx = info.cnt++;
      poly1.emplace_back(0, l - x);
      poly1.emplace_back(y, l - x);
      poly1.emplace_back(0, l);
      poly2.idx = info.cnt++;
      poly2.emplace_back(l, x);
      poly2.emplace_back(l, l);
      poly2.emplace_back(0, l);
      poly3.idx = info.cnt++;
      poly3.emplace_back(0, 0);
      poly3.emplace_back(w - y, 0);
      poly3.emplace_back(w - y, x);
      poly3.emplace_back(w - l, h);
      poly3.emplace_back(0, h);
      info.PV.emplace_back(poly1);
      info.PV.emplace_back(poly2);
      info.PV.emplace_back(poly3);
      info.EV.emplace_back(0, vector<POLY>({rect, poly1, poly2, poly3}));
      poly1[0] = {w - y, 0};
      poly1[1] = {w, 0};
      poly1[2] = {w - y, x};
      poly2[0] = {w, 0};
      poly2[1] = {w, h};
      poly2[2] = {w - l, h};
      rect.idx = info.cnt++;
      rect[1] = {w, 0};
      rect[2] = {w, h};
      rect[3] = {0, h};
      info.PV.emplace_back(rect);
      info.EV.emplace_back(1, vector<POLY>({poly1, poly2, poly3, rect}));
    }
  } else {
    long double x = h - l, y = l - w;
    POLY poly1, poly2, poly3;
    if (!isZero(l - h)) {
      poly1.idx = info.cnt++;
      poly1.emplace_back(l - y, 0);
      poly1.emplace_back(l, 0);
      poly1.emplace_back(l - y, x);
      poly2.idx = info.cnt++;
      poly2.emplace_back(l, 0);
      poly2.emplace_back(l, l);
      poly2.emplace_back(l - w, l);
      poly3.idx = info.cnt++;
      poly3.emplace_back(0, 0);
      poly3.emplace_back(w, 0);
      poly3.emplace_back(w, x);
      poly3.emplace_back(y, h - x);
      poly3.emplace_back(0, h - x);
      info.PV.emplace_back(poly1);
      info.PV.emplace_back(poly2);
      info.PV.emplace_back(poly3);
      info.EV.emplace_back(0, vector<POLY>({rect, poly1, poly2, poly3}));
      poly1[0] = {0, h - x};
      poly1[1] = {y, h - x};
      poly1[2] = {0, h};
      poly2[0] = {w, x};
      poly2[1] = {w, h};
      poly2[2] = {0, h};
      rect.idx = info.cnt++;
      rect[1] = {w, 0};
      rect[2] = {w, h};
      rect[3] = {0, h};
      info.PV.emplace_back(rect);
      info.EV.emplace_back(1, vector<POLY>({poly1, poly2, poly3, rect}));
    }
  }
  {
    POLY poly1, poly2;
    poly1.V.resize(4);
    poly2.V.resize(4);
    for (; runcnt1--;) {
      poly1.idx = info.cnt++;
      poly1[0] = {0, 0};
      poly1[1] = {w, 0};
      poly1[2] = {w, h / 2};
      poly1[3] = {0, h / 2};
      poly2.idx = info.cnt++;
      poly2[0] = {0, h / 2};
      poly2[1] = {w, h / 2};
      poly2[2] = {w, h};
      poly2[3] = {0, h};
      info.PV.emplace_back(poly1);
      info.PV.emplace_back(poly2);
      info.EV.emplace_back(0, vector<POLY>({rect, poly1, poly2}));
      poly2[0] = {w, 0};
      poly2[1] = {w * 2, 0};
      poly2[2] = {w * 2, h / 2};
      poly2[3] = {w, h / 2};
      rect.idx = info.cnt++;
      rect[1] = {w * 2, 0};
      rect[2] = {w * 2, h / 2};
      rect[3] = {0, h / 2};
      info.PV.emplace_back(rect);
      info.EV.emplace_back(1, vector<POLY>({poly1, poly2, rect}));
      h /= 2;
      w *= 2;
    }
    for (; runcnt2--;) {
      poly1.idx = info.cnt++;
      poly1[0] = {0, 0};
      poly1[1] = {w / 2, 0};
      poly1[2] = {w / 2, h};
      poly1[3] = {0, h};
      poly2.idx = info.cnt++;
      poly2[0] = {w / 2, 0};
      poly2[1] = {w, 0};
      poly2[2] = {w, h};
      poly2[3] = {w / 2, h};
      info.PV.emplace_back(poly1);
      info.PV.emplace_back(poly2);
      info.EV.emplace_back(0, vector<POLY>({rect, poly1, poly2}));
      poly2[0] = {0, h};
      poly2[1] = {w / 2, h};
      poly2[2] = {w / 2, h * 2};
      poly2[3] = {0, h * 2};
      rect.idx = info.cnt++;
      rect[1] = {w / 2, 0};
      rect[2] = {w / 2, h * 2};
      rect[3] = {0, h * 2};
      info.PV.emplace_back(rect);
      info.EV.emplace_back(1, vector<POLY>({poly1, poly2, rect}));
      w /= 2;
      h *= 2;
    }
  }
}
void mergeFixedH(INFO &info, vector<POLY> V, POLY &poly) {
  int n = ((int)(V).size());
  long double h = V[0][2].second, wsum = 0;
  for (int i = 0; i < n; i++) {
    auto &rect = V[i];
    long double w = rect[1].first;
    rect[0] = {wsum, 0};
    rect[1] = {wsum + w, 0};
    rect[2] = {wsum + w, h};
    rect[3] = {wsum, h};
    wsum += w;
  }
  poly.idx = info.cnt++;
  poly.emplace_back(0, 0);
  poly.emplace_back(wsum, 0);
  poly.emplace_back(wsum, h);
  poly.emplace_back(0, h);
  info.PV.emplace_back(poly);
  V.emplace_back(poly);
  info.EV.emplace_back(1, V);
}
void polygonToFixedH(INFO &info, POLY poly, long double h) {
  vector<POLY> triV;
  triangulation(info, poly, triV);
  vector<POLY> rectV;
  for (auto &tri : triV) {
    POLY rect;
    triToRect(info, tri, rect);
    rectToRatioTwo(info, rect);
    ratioTwoToSquare(info, rect);
    squareToFixedH(info, rect, h);
    rectV.emplace_back(rect);
  }
  POLY finalPoly;
  mergeFixedH(info, rectV, finalPoly);
}
POLY startPoly, endPoly;
void process() {
  INFO startInfo, endInfo;
  startInfo.cnt = 1;
  startInfo.PV.emplace_back(startPoly);
  endInfo.cnt = 1;
  endInfo.PV.emplace_back(endPoly);
  long double area = startPoly.getArea();
  long double hei = sqrt(area);
  polygonToFixedH(startInfo, startPoly, hei);
  polygonToFixedH(endInfo, endPoly, hei);
  mergeInfo(startInfo, endInfo);
  startInfo.prt();
}
void input() {
  int n;
  startPoly.idx = 0;
  cin >> n;
  for (long double x, y; n--;) {
    cin >> x >> y;
    startPoly.emplace_back(x, y);
  }
  endPoly.idx = 0;
  cin >> n;
  for (long double x, y; n--;) {
    cin >> x >> y;
    endPoly.emplace_back(x, y);
  }
}
int main() {
  input();
  process();
  return 0;
}