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;
template <class C>
constexpr int sz(const C &c) {
  return int(c.size());
}
using ll = long long;
constexpr const char nl = '\n', sp = ' ';
using ld = long double;
const ld EPS = 1e-9;
using Point = pair<ld, ld>;
using Polygon = pair<int, vector<Point>>;
using Group = vector<Polygon>;
using Operation = pair<Group, Group>;
using Sequence = vector<Operation>;
template <class T>
bool lt(const T &a, const T &b) {
  return a < b - T(EPS);
}
template <class T>
bool le(const T &a, const T &b) {
  return !lt(b, a);
}
template <class T>
bool gt(const T &a, const T &b) {
  return lt(b, a);
}
template <class T>
bool ge(const T &a, const T &b) {
  return !lt(a, b);
}
template <class T>
bool eq(const T &a, const T &b) {
  return !lt(a, b) && !lt(b, a);
}
template <class T>
bool ne(const T &a, const T &b) {
  return lt(a, b) || lt(b, a);
}
bool ltX(const Point &a, const Point &b) { return lt(a.first, b.first); }
bool ltY(const Point &a, const Point &b) { return lt(a.second, b.second); }
ld dist(const Point &a, const Point &b) {
  ld dx = a.first - b.first, dy = a.second - b.second;
  return sqrt(dx * dx + dy * dy);
}
int ccw(const Point &a, const Point &b, const Point &c) {
  ld a2 = (b.first - a.first) * (c.second - a.second) -
          (b.second - a.second) * (c.first - a.first);
  if (lt(a2, ld(0)))
    return -1;
  else if (gt(a2, ld(0)))
    return +1;
  else
    return 0;
}
ld area2(const Point &a, const Point &b, const Point &c) {
  return (b.first - a.first) * (c.second - a.second) -
         (b.second - a.second) * (c.first - a.first);
}
ld area2(const Polygon &P) {
  ld ret = 0;
  for (int i = 0; i < sz(P.second); i++)
    ret += area2(Point(0, 0), P.second[i], P.second[(i + 1) % sz(P.second)]);
  return ret;
}
Sequence reverseSeq(const Sequence &seq) {
  Sequence ret(seq);
  reverse(ret.begin(), ret.end());
  for (auto &&op : ret) op.first.swap(op.second);
  return ret;
}
int first = 1;
Polygon makeRect(ld minX, ld minY, ld maxX, ld maxY) {
  Polygon r;
  r.first = first++;
  r.second.emplace_back(minX, minY);
  r.second.emplace_back(maxX, minY);
  r.second.emplace_back(maxX, maxY);
  r.second.emplace_back(minX, maxY);
  return r;
}
Sequence rectToSquare(const Polygon &src, const Polygon &square) {
  Sequence seq;
  ld minX = min_element(src.second.begin(), src.second.end(), ltX)->first;
  ld maxX = max_element(src.second.begin(), src.second.end(), ltX)->first;
  ld minY = min_element(src.second.begin(), src.second.end(), ltY)->second;
  ld maxY = max_element(src.second.begin(), src.second.end(), ltY)->second;
  ld curWidth = maxX - minX;
  ld curHeight = maxY - minY;
  ld len = square.second[2].first;
  Polygon st = src;
  for (auto &&p : st.second) {
    p.first -= minX;
    p.second -= minY;
  }
  Polygon cur = makeRect(0, 0, curWidth, curHeight);
  seq.emplace_back(Group{st}, Group{cur});
  if (lt(curWidth, curHeight)) {
    swap(curWidth, curHeight);
    Polygon rot1 = makeRect(0, 0, curWidth, curHeight);
    Polygon rot2 = rot1;
    rot1.first = cur.first;
    rotate(rot1.second.begin(), rot1.second.begin() + 3, rot1.second.end());
    seq.emplace_back(Group{rot1}, Group{rot2});
    cur = rot2;
  }
  while (gt(curWidth, 2 * len)) {
    Polygon left = makeRect(0, 0, curWidth / 2, curHeight);
    Polygon right = makeRect(curWidth / 2, 0, curWidth, curHeight);
    seq.emplace_back(Group{cur}, Group{left, right});
    curWidth /= 2;
    curHeight *= 2;
    cur = makeRect(0, 0, curWidth, curHeight);
    Polygon bottom = makeRect(0, 0, curWidth, curHeight / 2);
    bottom.first = left.first;
    Polygon top = makeRect(0, curHeight / 2, curWidth, curHeight);
    top.first = right.first;
    seq.emplace_back(Group{bottom, top}, Group{cur});
  }
  if (ne(curWidth, len)) {
    Point p(len, curHeight);
    Point q(curWidth - len, 0);
    Point r(curWidth - len, len - curHeight);
    Polygon a{first++, {cur.second[0], q, r}};
    Polygon b{first++, {cur.second[0], p, cur.second[3]}};
    Polygon c{first++, {q, cur.second[1], cur.second[2], p, r}};
    seq.emplace_back(Group{cur}, Group{a, b, c});
    cur = makeRect(0, 0, len, len);
    p = Point(0, len - curHeight);
    q = Point(len, curHeight);
    r = Point(len - (curWidth - len), curHeight);
    Polygon d{a.first, {r, q, cur.second[2]}};
    Polygon e{b.first, {p, cur.second[2], cur.second[3]}};
    Polygon f{c.first, {cur.second[0], cur.second[1], q, r, p}};
    seq.emplace_back(Group{d, e, f}, Group{cur});
  }
  seq.emplace_back(Group{cur}, Group{square});
  return seq;
}
Sequence rectToRect(const Polygon &src, const Polygon &target) {
  ld len = sqrt(area2(src) / 2);
  Polygon square = makeRect(0, 0, len, len);
  Sequence A = rectToSquare(src, square),
           B = reverseSeq(rectToSquare(target, square));
  A.insert(A.end(), B.begin(), B.end());
  return A;
}
pair<Sequence, Polygon> triToArbRect(const Polygon &tri) {
  Sequence seq;
  vector<ld> lens;
  for (int i = 0; i < sz(tri.second); i++)
    lens.push_back(dist(tri.second[i], tri.second[(i + 1) % sz(tri.second)]));
  int ind = max_element(lens.begin(), lens.end(), lt<ld>) - lens.begin();
  ld base = lens[ind], height = area2(tri) / base;
  ld tx = lens[(ind + sz(lens) - 1) % sz(lens)];
  tx = sqrt(tx * tx - height * height);
  Polygon st;
  st.first = tri.first;
  st.second.emplace_back(0, 0);
  st.second.emplace_back(base, 0);
  st.second.emplace_back(tx, height);
  Polygon cur = st;
  cur.first = first++;
  rotate(st.second.begin(),
         st.second.begin() + (sz(st.second) - ind) % sz(st.second),
         st.second.end());
  seq.emplace_back(Group{st}, Group{cur});
  ld base1 = tx / 2, base2 = (base - tx) / 2;
  Point p(tx - base1, height / 2);
  Point q(tx, height / 2);
  Point r(tx + base2, height / 2);
  Polygon a{first++, {p, q, cur.second[2]}};
  Polygon b{first++, {q, r, cur.second[2]}};
  Polygon c{first++, {cur.second[0], cur.second[1], r, p}};
  seq.emplace_back(Group{cur}, Group{a, b, c});
  cur = makeRect(0, 0, base, height / 2);
  p = Point(base1, height / 2);
  r = Point(base - base2, height / 2);
  Polygon d{a.first, {p, cur.second[3], cur.second[0]}};
  Polygon e{b.first, {cur.second[2], r, cur.second[1]}};
  Polygon f{c.first, {cur.second[0], cur.second[1], r, p}};
  seq.emplace_back(Group{d, e, f}, Group{cur});
  return make_pair(seq, cur);
}
Sequence triToSquare(const Polygon &src, const Polygon &target) {
  Sequence A, B;
  Polygon rect;
  tie(A, rect) = triToArbRect(src);
  B = rectToSquare(rect, target);
  A.insert(A.end(), B.begin(), B.end());
  return A;
}
bool valid(const Point &a, const Point &b, const Point &c, const Polygon &P) {
  for (auto &&p : P.second)
    if (ccw(a, b, p) == 1 && ccw(b, c, p) == 1 && ccw(c, a, p) == 1)
      return false;
  return true;
}
pair<Sequence, Polygon> polyToArbSquare(const Polygon &P) {
  Sequence seq;
  Group tris;
  Polygon cur = P;
  while (sz(cur.second) > 2) {
    for (int i = 0; i < sz(cur.second); i++) {
      Point p = cur.second[i], q = cur.second[(i + 1) % sz(cur.second)],
            r = cur.second[(i + 2) % sz(cur.second)];
      if (ccw(p, q, r) == 1 && valid(p, q, r, cur)) {
        tris.emplace_back(first++, vector<Point>{p, q, r});
        cur.second.erase(cur.second.begin() + (i + 1) % sz(cur.second));
        break;
      }
    }
  }
  seq.emplace_back(Group{P}, tris);
  Polygon merged;
  merged.first = -1;
  ld totArea = 0;
  for (auto &&tri : tris) {
    ld a = area2(tri) / 2, len = sqrt(a);
    totArea += a;
    Polygon square = makeRect(0, 0, len, len);
    Sequence A = triToSquare(tri, square);
    seq.insert(seq.end(), A.begin(), A.end());
    if (merged.first == -1)
      merged = square;
    else {
      ld len = sqrt(totArea);
      Polygon bottom = makeRect(0, 0, len, a / len);
      Polygon top = makeRect(0, a / len, len, totArea / len);
      Sequence B = reverseSeq(rectToSquare(bottom, square)),
               C = reverseSeq(rectToSquare(top, merged));
      seq.insert(seq.end(), B.begin(), B.end());
      seq.insert(seq.end(), C.begin(), C.end());
      merged = makeRect(0, 0, len, len);
      seq.emplace_back(Group{bottom, top}, Group{merged});
    }
  }
  return make_pair(seq, merged);
}
Sequence polyToPoly(const Polygon &src, const Polygon &target) {
  Sequence A, B;
  Polygon SA, SB;
  tie(A, SA) = polyToArbSquare(src);
  tie(B, SB) = polyToArbSquare(target);
  B = reverseSeq(B);
  A.emplace_back(Group{SA}, Group{SB});
  A.insert(A.end(), B.begin(), B.end());
  return A;
}
Polygon readPolygon() {
  Polygon ret;
  ret.first = first++;
  int k;
  cin >> k;
  for (int i = 0; i < k; i++) {
    int first, second;
    cin >> first >> second;
    ret.second.emplace_back(first, second);
  }
  return ret;
}
void writeSeq(const Polygon &S, const Sequence &seq) {
  vector<int> indexToId(first, -1);
  int curId = 0;
  auto addId = [&](const Polygon &P) { return indexToId[P.first] = curId++; };
  auto removeId = [&](const Polygon &P) {
    int ret = indexToId[P.first];
    assert(ret != -1);
    indexToId[P.first] = -1;
    return ret;
  };
  auto writePolygon = [&](const Polygon &P) {
    cout << sz(P.second);
    for (auto &&p : P.second)
      cout << sp << fixed << setprecision(9) << p.first << sp << p.second;
    cout << nl;
  };
  auto writeOp = [&](const Operation &op) {
    if (sz(op.second) == 1) {
      cout << "tape" << nl;
      cout << sz(op.first);
      for (auto &&P : op.first) cout << sp << removeId(P);
      cout << nl;
      for (auto &&P : op.first) writePolygon(P);
      writePolygon(op.second[0]);
      addId(op.second[0]);
    } else {
      cout << "scissors" << nl;
      cout << removeId(op.first[0]) << sp << sz(op.second) << nl;
      for (auto &&P : op.second) {
        writePolygon(P);
        addId(P);
      }
    }
  };
  addId(S);
  for (auto &&op : seq) writeOp(op);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  Polygon S = readPolygon(), T = readPolygon();
  Sequence A = polyToPoly(S, T);
  writeSeq(S, A);
  return 0;
}