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 <typename T>
void ckmn(T &a, T b) {
  a = min(a, b);
}
template <typename T>
void ckmx(T &a, T b) {
  a = max(a, b);
}
int ri() {
  int x;
  scanf("%i", &x);
  return x;
}
void rd() {}
template <typename... T>
void rd(int &x, T &...args) {
  scanf("%i", &x);
  rd(args...);
}
template <typename... T>
void rd(long long &x, T &...args) {
  scanf("%lld", &x);
  rd(args...);
}
template <typename... T>
void rd(double &x, T &...args) {
  scanf("%lf", &x);
  rd(args...);
}
template <typename... T>
void rd(pair<int, int> &x, T &...args) {
  scanf("%i %i", &x.first, &x.second);
  rd(args...);
}
const double eps = 1e-9;
bool eq(double a, double b) { return fabs(a - b) < eps; }
struct pt {
  double x, y;
  pt() {}
  pt(double a, double b) : x(a), y(b) {}
};
pt operator+(pt a, pt b) { return pt(a.x + b.x, a.y + b.y); }
pt operator-(pt a, pt b) { return pt(a.x - b.x, a.y - b.y); }
pt operator*(double b, pt a) { return pt(a.x * b, a.y * b); }
pt operator/(pt a, double b) { return pt(a.x / b, a.y / b); }
bool operator==(pt a, pt b) { return eq(a.x, b.x) && eq(a.y, b.y); }
double cross(pt a, pt b) { return a.x * b.y - a.y * b.x; }
double dot(pt a, pt b) { return a.x * b.x + a.y * b.y; }
double sq(pt a) { return dot(a, a); }
double abs(pt a) { return sqrt(sq(a)); }
double dist(pt a, pt b) { return abs(a - b); }
struct ply {
  vector<pt> pts;
  int id;
  ply() : id(0) {}
  ply(vector<pt> ps) : pts(ps), id(0) {}
  void add(pt x) { pts.push_back(x); }
  pt &operator[](int i) { return pts[i]; }
  int sz() { return pts.size(); }
  bool is_rec() {
    return pts.size() == 4 && eq(pts[0].x, 0) && eq(pts[0].y, 0) &&
           eq(pts[1].y, 0) && eq(pts[3].x, 0) && eq(pts[1].x, pts[2].x) &&
           eq(pts[2].y, pts[3].y);
  }
  bool is_sq() { return is_rec() && eq(pts[2].x, pts[2].y); }
  bool is_tri() { return pts.size() == 3; }
  void p() {
    printf("%i ", pts.size());
    for (auto p : pts) printf("%.10f %.10f ", p.x, p.y);
    printf("\n");
  }
  double area() {
    double ans = 0;
    for (int i = 0, j = pts.size() - 1; i < pts.size(); j = i, i++) {
      ans += cross(pts[i], pts[j]);
    }
    return fabs(ans) / 2;
  }
};
ply operator+(ply a, pt b) {
  for (pt &p : a.pts) p = p + b;
  return a;
}
void rot(ply &a) {
  pt tmp = a[0];
  a[0] = a[1];
  a[1] = a[2];
  a[2] = tmp;
}
bool inside(pt a, pt b, pt c, pt d) {
  return eq(
      ply({a, b, c}).area(),
      ply({a, b, d}).area() + ply({a, c, d}).area() + ply({b, c, d}).area());
}
struct op {
  char typ;
  int shp;
  vector<int> fen;
};
op sci(int shp, vector<int> fen) {
  op ans;
  ans.typ = 's';
  ans.shp = shp;
  ans.fen = fen;
  return ans;
}
op tap(vector<int> fen, int shp) {
  op ans;
  ans.typ = 't';
  ans.shp = shp;
  ans.fen = fen;
  return ans;
}
op mve(int src, int dst) {
  op ans;
  ans.typ = 'm';
  ans.shp = src;
  ans.fen = {dst};
  return ans;
}
struct Solve {
  vector<ply> pls;
  vector<op> ops;
  int add(ply p) {
    pls.push_back(p);
    return pls.size() - 1;
  }
  int tri_to_rec(int tid) {
    ply tmp = pls[tid];
    int cnt = 0;
    while (1) {
      double a = dist(tmp[0], tmp[1]);
      double b = dist(tmp[1], tmp[2]);
      double c = dist(tmp[2], tmp[0]);
      if (b > a || c > a) {
        rot(tmp);
        cnt++;
        continue;
      }
      double A = pls[tid].area();
      double h = (A * 2) / a;
      double x = sqrt(c * c - h * h);
      int aid;
      if (cnt == 0) aid = add(ply({pt(0, 0), pt(a, 0), pt(x, h)}));
      if (cnt == 1) aid = add(ply({pt(x, h), pt(0, 0), pt(a, 0)}));
      if (cnt == 2) aid = add(ply({pt(a, 0), pt(x, h), pt(0, 0)}));
      ops.push_back(mve(tid, aid));
      pt l = (pt(0, 0) + pt(x, h)) / 2, r = (pt(x, h) + pt(a, 0)) / 2;
      int bid = add(ply({pt(0, 0), pt(a, 0), r, l}));
      int cid = add(ply({pt(x, h / 2), pt(x, h), l}));
      int did = add(ply({pt(x, h / 2), r, pt(x, h)}));
      ops.push_back(sci(aid, {bid, cid, did}));
      int eid = add(ply({pt(0, h / 2), pt(0, 0), l}));
      ops.push_back(mve(cid, eid));
      int fid = add(ply({pt(a, h / 2), r, pt(a, 0)}));
      ops.push_back(mve(did, fid));
      int gid = add(ply({pt(0, 0), pt(a, 0), pt(a, h / 2), pt(0, h / 2)}));
      ops.push_back(tap({bid, eid, fid}, gid));
      return gid;
    }
  }
  int rsz_rec_h(int rid, double s) {
    assert(pls[rid].is_rec());
    double h = pls[rid][2].y, w = pls[rid][2].x;
    if (eq(h, s)) return rid;
    if (s > h * 2) {
      ply tmp = ply({pt(0, 0), pt(w / 2, 0), pt(w / 2, h), pt(0, h)});
      int aid = add(tmp);
      int bid = add(tmp + pt(w / 2, 0));
      ops.push_back(sci(rid, {aid, bid}));
      int cid = add(tmp + pt(0, h));
      ops.push_back(mve(bid, cid));
      int did =
          add(ply({pt(0, 0), pt(w / 2, 0), pt(w / 2, h * 2), pt(0, h * 2)}));
      ops.push_back(tap({aid, cid}, did));
      return rsz_rec_h(did, s);
    } else if (h > 2 * s) {
      ply tmp = ply({pt(0, 0), pt(w, 0), pt(w, h / 2), pt(0, h / 2)});
      int aid = add(tmp);
      int bid = add(tmp + pt(0, h / 2));
      ops.push_back(sci(rid, {aid, bid}));
      int cid = add(tmp + pt(w, 0));
      ops.push_back(mve(bid, cid));
      int did =
          add(ply({pt(0, 0), pt(w * 2, 0), pt(w * 2, h / 2), pt(0, h / 2)}));
      ops.push_back(tap({aid, cid}, did));
      return rsz_rec_h(did, s);
    } else if (s > h) {
      double t = h * w / s, x = s - h, y = w - t;
      int aid = add(ply({pt(0, 0), pt(t, 0), pt(t, x), pt(y, h), pt(0, h)}));
      int bid = add(ply({pt(t, 0), pt(w, 0), pt(t, x)}));
      int cid = add(ply({pt(w, 0), pt(w, h), pt(y, h)}));
      ops.push_back(sci(rid, {aid, bid, cid}));
      int did = add(ply({pt(0, h), pt(y, h), pt(0, s)}));
      ops.push_back(mve(bid, did));
      int eid = add(ply({pt(t, x), pt(t, s), pt(0, s)}));
      ops.push_back(mve(cid, eid));
      int sid = add(ply({pt(0, 0), pt(t, 0), pt(t, s), pt(0, s)}));
      ops.push_back(tap({aid, did, eid}, sid));
      return sid;
    } else {
      double t = h * w / s, x = h - s, y = t - w;
      int aid = add(ply({pt(0, 0), pt(w, 0), pt(w, x), pt(y, s), pt(0, s)}));
      int bid = add(ply({pt(0, s), pt(y, s), pt(0, h)}));
      int cid = add(ply({pt(w, x), pt(w, h), pt(0, h)}));
      ops.push_back(sci(rid, {aid, bid, cid}));
      int did = add(ply({pt(w, 0), pt(t, 0), pt(w, x)}));
      ops.push_back(mve(bid, did));
      int eid = add(ply({pt(t, 0), pt(t, s), pt(y, s)}));
      ops.push_back(mve(cid, eid));
      int sid = add(ply({pt(0, 0), pt(t, 0), pt(t, s), pt(0, s)}));
      ops.push_back(tap({aid, did, eid}, sid));
      return sid;
    }
  }
  int rec_to_sq(int rid) {
    double s = sqrt(pls[rid][2].x * pls[rid][2].y);
    return rsz_rec_h(rid, s);
  }
  int tri_to_sq(int tid) { return rec_to_sq(tri_to_rec(tid)); }
  int mrg_sqs(int sid1, int sid2) {
    double s1 = pls[sid1][1].x, s2 = pls[sid2][1].x,
           s = sqrt(s1 * s1 + s2 * s2);
    int rid1 = rsz_rec_h(sid1, s);
    int rid2 = rsz_rec_h(sid2, s);
    double w1 = pls[rid1][2].x;
    int aid = add(ply({pt(w1, 0), pt(s, 0), pt(s, s), pt(w1, s)}));
    ops.push_back(mve(rid2, aid));
    int bid = add(ply({pt(0, 0), pt(s, 0), pt(s, s), pt(0, s)}));
    ops.push_back(tap({rid1, aid}, bid));
    return bid;
  }
  int ply_to_sq(int pid) {
    ply tmp = pls[pid];
    vector<int> tri;
    while (tmp.sz() >= 3) {
      for (int i = 0, l = tmp.sz() - 1, r = 1; i < tmp.sz();
           l = i, i++, r = r + 1 == tmp.sz() ? 0 : r + 1) {
        if (cross(tmp[i] - tmp[l], tmp[r] - tmp[l]) > 0) {
          bool ok = 1;
          for (int j = 0; j < tmp.sz(); j++)
            if (j != l && j != i && j != r)
              ok &= !inside(tmp[l], tmp[i], tmp[r], tmp[j]);
          if (!ok) continue;
          tri.push_back(add(ply({tmp[l], tmp[i], tmp[r]})));
          tmp.pts.erase(tmp.pts.begin() + i);
        }
      }
    }
    ops.push_back(sci(pid, tri));
    vector<int> sqs;
    for (int i : tri) sqs.push_back(tri_to_sq(i));
    while (sqs.size() > 1) {
      int i = sqs.back();
      sqs.pop_back();
      sqs.back() = mrg_sqs(sqs.back(), i);
    }
    return sqs[0];
  }
  int to_sq(int pid) {
    if (pls[pid].is_rec()) return rec_to_sq(pid);
    if (pls[pid].is_tri()) return tri_to_sq(pid);
    return ply_to_sq(pid);
  }
} A, B;
int solve(Solve &A) {
  ply st;
  int n = ri();
  for (int i = 1, x, y; i <= n; i++) rd(x, y), st.add(pt(x, y));
  int pid = A.add(st);
  return A.to_sq(pid);
}
int main() {
  int aid = solve(A);
  int bid = solve(B);
  vector<ply> pls;
  vector<op> ops;
  for (ply p : A.pls) pls.push_back(p);
  for (ply p : B.pls) pls.push_back(p);
  auto cng = [&](int &i) {
    if (i == bid)
      i = aid;
    else
      i += A.pls.size();
  };
  for (op o : A.ops) ops.push_back(o);
  reverse(B.ops.begin(), B.ops.end());
  for (op &o : B.ops) {
    cng(o.shp);
    for (int &i : o.fen) cng(i);
    if (o.typ == 's')
      o.typ = 't';
    else if (o.typ == 't')
      o.typ = 's';
    else
      swap(o.shp, o.fen[0]);
    ops.push_back(o);
  }
  int cnt = 0;
  for (op o : ops) {
    if (o.typ == 's') {
      printf("scissors\n");
      printf("%i %i\n", pls[o.shp].id, o.fen.size());
      for (int i : o.fen) {
        pls[i].id = ++cnt;
        pls[i].p();
      }
    } else if (o.typ == 't') {
      printf("tape\n");
      printf("%i ", o.fen.size());
      for (int i : o.fen) printf("%i ", pls[i].id);
      printf("\n");
      for (int i : o.fen) pls[i].p();
      pls[o.shp].id = ++cnt;
      pls[o.shp].p();
    } else {
      printf("tape\n");
      printf("1 %i\n", pls[o.shp].id);
      pls[o.fen[0]].p();
      pls[o.fen[0]].p();
      pls[o.fen[0]].id = ++cnt;
    }
  }
  return 0;
}