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;
using xy_t = double;
constexpr xy_t eps = 1e-6;
constexpr double pi = 3.14159265358979323846;
struct Point {
  xy_t x, y;
  Point() {}
  Point(xy_t x_, xy_t y_) : x{x_}, y{y_} {}
  Point operator+(const Point p) const {
    return {this->x + p.x, this->y + p.y};
  }
  Point* operator+=(const Point p) {
    this->x += p.x;
    this->y += p.y;
    return this;
  }
  Point operator-(const Point p) const {
    return {this->x - p.x, this->y - p.y};
  }
  Point* operator-=(const Point p) {
    this->x -= p.x;
    this->y -= p.y;
    return this;
  }
  Point operator*(double c) const { return {this->x * c, this->y * c}; }
  Point* operator*=(double c) {
    this->x *= c;
    this->y *= c;
    return this;
  }
  Point operator^(double c) const {
    return {this->x * cos(c) - this->y * sin(c),
            this->y * cos(c) + this->x * sin(c)};
  }
  double get_rot(const Point p) const {
    double rot_this = atan2(this->y, this->x);
    double rot_p = atan2(p.y, p.x);
    double rot = rot_p - rot_this;
    while (rot < 0) rot += 2 * pi;
    while (rot > 2 * pi) rot -= 2 * pi;
    return rot;
  }
};
xy_t dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
xy_t dot(Point a, Point b, Point o) { return dot(a - o, b - o); }
xy_t cross(Point a, Point b) { return a.x * b.y - b.x * a.y; }
xy_t cross(Point a, Point b, Point o) { return cross(a - o, b - o); }
int sign(xy_t x) { return ((x > 0) ? 1 : ((x < 0) ? -1 : 0)); }
bool point_in_triangle(Point A, Point B, Point C, Point P) {
  if (sign(cross(A, B, C)) != sign(cross(P, B, C))) return false;
  if (sign(cross(B, C, A)) != sign(cross(P, C, A))) return false;
  if (sign(cross(C, A, B)) != sign(cross(P, A, B))) return false;
  return true;
}
struct Shape {
  vector<Point> V;
  Shape(initializer_list<Point> init) : V(init) {}
  Shape() {}
  Shape(int N) : V(N) {}
  Shape(vector<Point> V_) : V(V_) {}
  int size() { return V.size(); }
  Shape operator^(double c) {
    Shape ret(V.size());
    for (int i = 0; i < (int)V.size(); i++) ret.V[i] = V[i] ^ c;
    return ret;
  }
};
struct RectangleSequence {
  vector<xy_t> H, W;
  int size() { return H.size(); }
};
struct OperationPair {
  Shape start_shape;
  vector<Shape> parts_first;
  vector<Shape> parts_moved;
  Shape final_shape;
};
vector<OperationPair> invert(vector<OperationPair> ops) {
  reverse(begin(ops), end(ops));
  for (auto& op : ops) {
    swap(op.start_shape, op.final_shape);
    swap(op.parts_first, op.parts_moved);
  }
  return ops;
}
void rotl(Point& A, Point& B, Point& C) {
  Point tmp = A;
  A = B;
  B = C;
  C = tmp;
}
void rotr(Point& A, Point& B, Point& C) {
  Point tmp = C;
  C = B;
  B = A;
  A = tmp;
}
RectangleSequence triangulate_to_rectangles(Shape s,
                                            vector<OperationPair>& ops) {
  vector<Point> V = s.V;
  RectangleSequence ret;
  OperationPair op;
  op.start_shape = s;
  op.final_shape = {{0, 0}};
  double r_H = 0;
  while (V.size() > 2U) {
    int N = V.size();
    for (int i = 0; i < N; i++) {
      Point A = V[(i + N - 1) % N], B = V[i], C = V[(i + 1) % N];
      if (cross(B, C, A) < 0) continue;
      bool can_be_cut = true;
      for (int j = 0; j < N; j++) {
        if (i == j || (i + 1 - j) % N == 0 || (i - 1 - j) % N == 0) continue;
        if (point_in_triangle(A, B, C, V[j])) can_be_cut = false;
      }
      if (!can_be_cut) continue;
      xy_t lA = dot(B - C, B - C), lB = dot(A - C, A - C),
           lC = dot(A - B, A - B);
      double cos_A = (lB + lC - lA) / 2 / sqrt(lB * lC);
      double cos_B = (lA + lC - lB) / 2 / sqrt(lA * lC);
      double cos_C = (lA + lB - lC) / 2 / sqrt(lA * lB);
      if (cos_B < min(cos_A, cos_C))
        rotl(A, B, C);
      else if (cos_C < min(cos_A, cos_B))
        rotr(A, B, C);
      lA = dot(B - C, B - C), lB = dot(A - C, A - C), lC = dot(A - B, A - B);
      cos_A = (lB + lC - lA) / 2 / sqrt(lB * lC);
      cos_B = (lA + lC - lB) / 2 / sqrt(lA * lC);
      cos_C = (lA + lB - lC) / 2 / sqrt(lA * lB);
      Point cB = (A + B) * .5, cC = (A + C) * .5;
      xy_t dB = sqrt(lC) / 2 * cos_B, dC = sqrt(lB) / 2 * cos_C;
      xy_t w = sqrt(lC) * sqrt(1 - cos_B * cos_B);
      op.parts_first.push_back({B, B + (C - B) * (dB / sqrt(lA)), cB});
      op.parts_moved.push_back(
          {{w, r_H + dC}, {w, r_H + dC + dB}, {w / 2, r_H + dC + dB}});
      op.parts_first.push_back({C, cC, C + (B - C) * (dC / sqrt(lA))});
      op.parts_moved.push_back({{w, r_H + dC}, {w / 2, r_H}, {w, r_H}});
      op.parts_first.push_back({C + (B - C) * (dC / sqrt(lA)), cC, A, cB,
                                B + (C - B) * (dB / sqrt(lA))});
      op.parts_moved.push_back({{0, r_H},
                                {w / 2, r_H},
                                {w, r_H + dC},
                                {w / 2, r_H + dC + dB},
                                {0, r_H + dC + dB}});
      op.final_shape.V.push_back({w, r_H});
      op.final_shape.V.push_back({w, r_H + dB + dC});
      r_H += dB + dC;
      ret.H.push_back(dB + dC);
      ret.W.push_back(w);
      V.erase(begin(V) + i);
      break;
    }
  }
  op.final_shape.V.push_back({0, r_H});
  ops.push_back(op);
  return ret;
}
RectangleSequence normalise_rectangles(RectangleSequence s,
                                       vector<OperationPair>& ops) {
  int N = s.size();
  vector<xy_t>& H = s.H;
  vector<xy_t>& W = s.W;
  xy_t area = 0;
  for (int i = 0; i < N; i++) area += H[i] * W[i];
  xy_t a = sqrt(area);
  while (true) {
    RectangleSequence nxt;
    xy_t cur_H = 0, new_H = 0;
    OperationPair op;
    op.start_shape = ops.back().final_shape;
    op.final_shape = {{0, 0}};
    bool stop = true;
    for (int i = 0; i < N; i++) {
      if (W[i] < a - eps) {
        stop = false;
        op.parts_first.push_back({{0, cur_H},
                                  {W[i], cur_H},
                                  {W[i], cur_H + H[i] / 2},
                                  {0, cur_H + H[i] / 2}});
        op.parts_moved.push_back({{0, new_H},
                                  {W[i], new_H},
                                  {W[i], new_H + H[i] / 2},
                                  {0, new_H + H[i] / 2}});
        op.parts_first.push_back({{0, cur_H + H[i] / 2},
                                  {W[i], cur_H + H[i] / 2},
                                  {W[i], cur_H + H[i]},
                                  {0, cur_H + H[i]}});
        op.parts_moved.push_back({{W[i], new_H},
                                  {2 * W[i], new_H},
                                  {2 * W[i], new_H + H[i] / 2},
                                  {W[i], new_H + H[i] / 2}});
        op.final_shape.V.push_back({2 * W[i], new_H});
        op.final_shape.V.push_back({2 * W[i], new_H + H[i] / 2});
        new_H += H[i] / 2;
        nxt.W.push_back(W[i] * 2);
        nxt.H.push_back(H[i] / 2);
      } else if (W[i] > 2 * a + eps) {
        stop = false;
        op.parts_first.push_back({{0, cur_H},
                                  {W[i] / 2, cur_H},
                                  {W[i] / 2, cur_H + H[i]},
                                  {0, cur_H + H[i]}});
        op.parts_moved.push_back({{0, new_H},
                                  {W[i] / 2, new_H},
                                  {W[i] / 2, new_H + H[i]},
                                  {0, new_H + H[i]}});
        op.parts_first.push_back({{W[i] / 2, cur_H},
                                  {W[i], cur_H},
                                  {W[i], cur_H + H[i]},
                                  {W[i] / 2, cur_H + H[i]}});
        op.parts_moved.push_back({{0, new_H + H[i]},
                                  {W[i] / 2, new_H + H[i]},
                                  {W[i] / 2, new_H + 2 * H[i]},
                                  {0, new_H + 2 * H[i]}});
        op.final_shape.V.push_back({W[i] / 2, new_H});
        op.final_shape.V.push_back({W[i] / 2, new_H + 2 * H[i]});
        new_H += H[i] * 2;
        nxt.W.push_back(W[i] / 2);
        nxt.H.push_back(H[i] * 2);
      } else {
        op.parts_first.push_back({{0, cur_H},
                                  {W[i], cur_H},
                                  {W[i], cur_H + H[i]},
                                  {0, cur_H + H[i]}});
        op.parts_moved.push_back({{0, new_H},
                                  {W[i], new_H},
                                  {W[i], new_H + H[i]},
                                  {0, new_H + H[i]}});
        op.final_shape.V.push_back({W[i], new_H});
        op.final_shape.V.push_back({W[i], new_H + H[i]});
        new_H += H[i];
        nxt.W.push_back(W[i]);
        nxt.H.push_back(H[i]);
      }
      cur_H += H[i];
    }
    op.final_shape.V.push_back({0, new_H});
    ops.push_back(op);
    s = nxt;
    if (stop) break;
  }
  return s;
}
void rectangles_to_unit_rectangle(RectangleSequence s,
                                  vector<OperationPair>& ops) {
  int N = s.size();
  xy_t cur_H = 0, nxt_H = 0;
  OperationPair op;
  op.start_shape = ops.back().final_shape;
  vector<xy_t>& H = s.H;
  vector<xy_t>& W = s.W;
  xy_t area = 0;
  for (int i = 0; i < N; i++) area += H[i] * W[i];
  xy_t a = sqrt(area);
  for (int i = 0; i < N; i++) {
    if (W[i] < a + eps) {
      op.parts_first.push_back(
          {{0, cur_H}, {W[i], cur_H}, {W[i], cur_H + H[i]}, {0, cur_H + H[i]}});
      op.parts_moved.push_back(
          {{0, nxt_H}, {1, nxt_H}, {1, nxt_H + H[i]}, {0, nxt_H + H[i]}});
      cur_H += H[i];
      nxt_H += H[i];
      continue;
    }
    xy_t d = W[i] - a;
    xy_t hr = H[i] / a;
    op.parts_first.push_back({{0, cur_H}, {a, cur_H}, {0, cur_H + H[i]}});
    op.parts_moved.push_back({{0, nxt_H}, {a, nxt_H}, {0, nxt_H + H[i]}});
    op.parts_first.push_back(
        {{0, cur_H + H[i]}, {d, cur_H + H[i] - d * hr}, {d, cur_H + H[i]}});
    op.parts_moved.push_back(
        {{a - d, nxt_H + d * hr}, {a, nxt_H}, {a, nxt_H + d * hr}});
    op.parts_first.push_back({{d, cur_H + H[i]},
                              {d, cur_H + H[i] - d * hr},
                              {a, cur_H},
                              {W[i], cur_H},
                              {W[i], cur_H + H[i]}});
    op.parts_moved.push_back({{0, nxt_H + W[i] * hr},
                              {0, nxt_H + H[i]},
                              {a - d, nxt_H + d * hr},
                              {a, nxt_H + d * hr},
                              {a, nxt_H + W[i] * hr}});
    cur_H += H[i];
    nxt_H += W[i] * H[i] / a;
  }
  op.final_shape = {{0, 0}, {a, 0}, {a, nxt_H}, {0, nxt_H}};
  ops.push_back(op);
}
vector<OperationPair> solve(Shape start_shape) {
  vector<OperationPair> ret;
  RectangleSequence rs = triangulate_to_rectangles(start_shape, ret);
  RectangleSequence rs_norm = normalise_rectangles(rs, ret);
  rectangles_to_unit_rectangle(rs_norm, ret);
  return ret;
}
Shape read_shape() {
  int N;
  cin >> N;
  Shape ret(N);
  for (int i = 0; i < N; i++) cin >> ret.V[i].x >> ret.V[i].y;
  return ret;
}
Shape clean_shape(Shape s) {
  vector<Point> V_clean{s.V[0]};
  int N = s.size();
  for (int i = 1; i < N; i++)
    if (sqrt(dot(s.V[i] - s.V[i - 1], s.V[i] - s.V[i - 1])) > eps)
      V_clean.push_back(s.V[i]);
  return Shape(V_clean);
}
void print_shape(Shape s) {
  s = clean_shape(s);
  cout << s.V.size();
  for (auto p : s.V) cout << " " << p.x << " " << p.y;
  cout << "\n";
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  Shape start = read_shape();
  Shape target = read_shape();
  vector<OperationPair> op1 = solve(start), op2 = solve(target);
  op2 = invert(op2);
  op1.insert(end(op1), begin(op2), end(op2));
  int current_id = 0;
  for (auto p : op1) {
    cout << "scissors\n";
    cout << current_id << " " << p.parts_first.size() << "\n";
    for (auto s : p.parts_first) print_shape(s);
    int new_id = current_id + p.parts_first.size() + 1;
    cout << "tape\n";
    cout << p.parts_moved.size();
    for (int i = current_id + 1; i < new_id; i++) cout << " " << i;
    cout << "\n";
    for (auto s : p.parts_moved) print_shape(s);
    print_shape(p.final_shape);
    current_id = new_id;
  }
  return 0;
}