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;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
const double eps = 1e-9;
struct P {
  double x, y;
  P() {}
  P(double x, double y) : x(x), y(y) {}
};
P operator-(const P &a, const P &b) { return P(a.x - b.x, a.y - b.y); }
P operator+(const P &a, const P &b) { return P(a.x + b.x, a.y + b.y); }
P operator*(const double &a, const P &b) { return P(a * b.x, a * b.y); }
double len(const P &a) { return sqrt(a.x * a.x + a.y * a.y); }
double dist(const P &a, const P &b) { return len(b - a); }
double cross(const P &a, const P &b) { return a.x * b.y - a.y * b.x; }
double dot(const P &a, const P &b) { return a.x * b.x + a.y * b.y; }
bool operator==(const P &a, const P &b) {
  return fabs(a.x - b.x) < eps && fabs(a.y - b.y) < eps;
}
double signedlinepointdist(const P &a, const P &b, const P &c) {
  P d = b - a;
  return cross(c - a, d) / len(d);
}
double projectlength(const P &a, const P &b, const P &c) {
  P d = b - a;
  return fabs(dot(c - a, d)) / len(d);
}
double side(const P &a, const P &b, const P &c) { return cross(b - a, c - a); }
bool inside(const P &a, const P &b, const P &c, const P &d) {
  return side(a, b, d) >= 0 && side(b, c, d) >= 0 && side(c, a, d) >= 0;
}
P mid(const P &a, const P &b) { return P((a.x + b.x) / 2, (a.y + b.y) / 2); }
P perp(const P &d) {
  P u = (1 / len(d)) * d;
  return P(-u.y, u.x);
}
struct Pol {
  vector<P> p;
  int outputid;
  bool isrect() {
    if (((int)(p).size()) != 4) return false;
    double w = p[2].x, h = p[2].y;
    return p[0] == P(0, 0) && p[1] == P(w, 0) && p[2] == P(w, h) &&
           p[3] == P(0, h);
  }
  bool istri() { return ((int)(p).size()) == 3; }
  bool issquare() {
    if (((int)(p).size()) != 4) return false;
    double sz = p[2].x;
    return p[0] == P(0, 0) && p[1] == P(sz, 0) && p[2] == P(sz, sz) &&
           p[3] == P(0, sz);
  }
  void add(double x, double y) { p.push_back(P(x, y)); }
  void add(const P &a) { p.push_back(a); }
  Pol translate(double dx, double dy) {
    Pol ret;
    for (int i = (0); i < (((int)(p).size())); ++i)
      ret.add(p[i].x + dx, p[i].y + dy);
    return ret;
  }
  void print() {
    for (int i = (0); i < (((int)(p).size())); ++i)
      printf("(%.5lg,%0.5lg)", p[i].x, p[i].y);
  }
};
bool operator==(const Pol &a, const Pol &b) { return a.p == b.p; }
struct Op {
  char kind;
  int full;
  vector<int> parts;
};
Op cutintotwo(int full, int part1, int part2) {
  Op ret;
  ret.kind = 'S';
  ret.full = full;
  ret.parts.push_back(part1);
  ret.parts.push_back(part2);
  return ret;
}
Op mergetwo(int part1, int part2, int full) {
  Op ret;
  ret.kind = 'T';
  ret.parts.push_back(part1);
  ret.parts.push_back(part2);
  ret.full = full;
  return ret;
}
Op cutintothree(int full, int part1, int part2, int part3) {
  Op ret;
  ret.kind = 'S';
  ret.full = full;
  ret.parts.push_back(part1);
  ret.parts.push_back(part2);
  ret.parts.push_back(part3);
  return ret;
}
Op mergethree(int part1, int part2, int part3, int full) {
  Op ret;
  ret.kind = 'T';
  ret.parts.push_back(part1);
  ret.parts.push_back(part2);
  ret.parts.push_back(part3);
  ret.full = full;
  return ret;
}
Op mergefour(int part1, int part2, int part3, int part4, int full) {
  Op ret;
  ret.kind = 'T';
  ret.parts.push_back(part1);
  ret.parts.push_back(part2);
  ret.parts.push_back(part3);
  ret.parts.push_back(part4);
  ret.full = full;
  return ret;
}
Op mergefive(int part1, int part2, int part3, int part4, int part5, int full) {
  Op ret;
  ret.kind = 'T';
  ret.parts.push_back(part1);
  ret.parts.push_back(part2);
  ret.parts.push_back(part3);
  ret.parts.push_back(part4);
  ret.parts.push_back(part5);
  ret.full = full;
  return ret;
}
Op move(int from, int to) {
  Op ret;
  ret.kind = 'M';
  ret.parts.push_back(from);
  ret.full = to;
  return ret;
}
struct Sequence {
  vector<Pol> pols;
  vector<Op> ops;
  void init() {
    pols.clear();
    ops.clear();
  }
  int add(Pol pol) {
    int ret = ((int)(pols).size());
    pols.push_back(pol);
    return ret;
  }
  int rect2square(int id) {
    assert(pols[id].isrect());
    double w = pols[id].p[2].x, h = pols[id].p[2].y;
    if (fabs(w - h) < eps) return id;
    if (w > 2 * h) {
      Pol a;
      a.add(0, 0);
      a.add(w / 2, 0);
      a.add(w / 2, h);
      a.add(0, h);
      int aid = add(a);
      Pol b;
      b.add(w / 2, 0);
      b.add(w, 0);
      b.add(w, h);
      b.add(w / 2, h);
      int bid = add(b);
      Pol bb = b.translate(-w / 2, h);
      int bbid = add(bb);
      Pol c;
      c.add(0, 0);
      c.add(w / 2, 0);
      c.add(w / 2, 2 * h);
      c.add(0, 2 * h);
      int cid = add(c);
      ops.push_back(cutintotwo(id, aid, bid));
      ops.push_back(move(bid, bbid));
      ops.push_back(mergetwo(aid, bbid, cid));
      return rect2square(cid);
    } else if (h > 2 * w) {
      Pol a;
      a.add(0, 0);
      a.add(w, 0);
      a.add(w, h / 2);
      a.add(0, h / 2);
      int aid = add(a);
      Pol b;
      b.add(0, h / 2);
      b.add(w, h / 2);
      b.add(w, h);
      b.add(0, h);
      int bid = add(b);
      Pol bb = b.translate(w, -h / 2);
      int bbid = add(bb);
      Pol c;
      c.add(0, 0);
      c.add(2 * w, 0);
      c.add(2 * w, h / 2);
      c.add(0, h / 2);
      int cid = add(c);
      ops.push_back(cutintotwo(id, aid, bid));
      ops.push_back(move(bid, bbid));
      ops.push_back(mergetwo(aid, bbid, cid));
      return rect2square(cid);
    } else if (w < h) {
      double side = sqrt(w * h), y = h * (side - w) / side,
             x = side * (h - side) / h;
      Pol a;
      a.add(0, 0);
      a.add(w, 0);
      a.add(w, y);
      a.add(x, side);
      a.add(0, side);
      int aid = add(a);
      Pol b;
      b.add(w, y);
      b.add(w, h);
      b.add(0, h);
      int bid = add(b);
      Pol bb = b.translate(side - w, -y);
      int bbid = add(bb);
      Pol c;
      c.add(0, side);
      c.add(x, side);
      c.add(0, h);
      int cid = add(c);
      Pol cc = c.translate(w, -side);
      int ccid = add(cc);
      Pol d;
      d.add(0, 0);
      d.add(side, 0);
      d.add(side, side);
      d.add(0, side);
      int did = add(d);
      ops.push_back(cutintothree(id, aid, bid, cid));
      ops.push_back(move(bid, bbid));
      ops.push_back(move(cid, ccid));
      ops.push_back(mergethree(aid, bbid, ccid, did));
      return did;
    } else {
      double side = sqrt(w * h), y = side * (w - side) / w,
             x = w * (side - h) / side;
      Pol a;
      a.add(0, 0);
      a.add(side, 0);
      a.add(side, y);
      a.add(x, h);
      a.add(0, h);
      int aid = add(a);
      Pol b;
      b.add(x, h);
      b.add(w, 0);
      b.add(w, h);
      int bid = add(b);
      Pol bb = b.translate(-x, y);
      int bbid = add(bb);
      Pol c;
      c.add(side, 0);
      c.add(w, 0);
      c.add(side, y);
      int cid = add(c);
      Pol cc = c.translate(-side, h);
      int ccid = add(cc);
      Pol d;
      d.add(0, 0);
      d.add(side, 0);
      d.add(side, side);
      d.add(0, side);
      int did = add(d);
      ops.push_back(cutintothree(id, aid, bid, cid));
      ops.push_back(move(bid, bbid));
      ops.push_back(move(cid, ccid));
      ops.push_back(mergethree(aid, bbid, ccid, did));
      return did;
    }
  }
  int tri2rect(int id) {
    assert(pols[id].istri());
    P A = pols[id].p[0], B = pols[id].p[1], C = pols[id].p[2];
    for (int i = (1); i <= (2); ++i) {
      P AA = pols[id].p[i], BB = pols[id].p[(i + 1) % 3],
        CC = pols[id].p[(i + 2) % 3];
      if (dist(AA, BB) > dist(A, B)) A = AA, B = BB, C = CC;
    }
    double w = dist(A, B), h = signedlinepointdist(A, B, C),
           x = projectlength(A, B, C);
    Pol a;
    a.add(A);
    a.add(B);
    a.add(mid(B, C));
    a.add(mid(A, C));
    int aid = add(a);
    Pol b;
    b.add(mid(B, C));
    b.add(C);
    b.add(C + (h / 2) * perp(B - A));
    int bid = add(b);
    Pol c;
    c.add(mid(A, C));
    c.add(C + (h / 2) * perp(B - A));
    c.add(C);
    int cid = add(c);
    ops.push_back(cutintothree(id, aid, bid, cid));
    Pol aa;
    aa.add(0, 0);
    aa.add(w, 0);
    aa.add((w + x) / 2, fabs(h) / 2);
    aa.add(x / 2, fabs(h) / 2);
    int aaid = add(aa);
    Pol bb;
    bb.add((w + x) / 2, fabs(h) / 2);
    bb.add(w, 0);
    bb.add(w, fabs(h / 2));
    int bbid = add(bb);
    Pol cc;
    cc.add(x / 2, fabs(h) / 2);
    cc.add(0, fabs(h) / 2);
    cc.add(0, 0);
    int ccid = add(cc);
    Pol d;
    d.add(0, 0);
    d.add(w, 0);
    d.add(w, fabs(h) / 2);
    d.add(0, fabs(h) / 2);
    int did = add(d);
    ops.push_back(move(aid, aaid));
    ops.push_back(move(bid, bbid));
    ops.push_back(move(cid, ccid));
    ops.push_back(mergethree(aaid, bbid, ccid, did));
    return did;
  }
  int joinsquares(int id1, int id2) {
    assert(pols[id1].issquare() && pols[id2].issquare());
    double sz1 = pols[id1].p[2].x, sz2 = pols[id2].p[2].x,
           sz = sqrt(sz1 * sz1 + sz2 * sz2);
    if (sz1 < sz2) {
      swap(id1, id2);
      swap(sz1, sz2);
    }
    if (fabs(sz1 - sz2) < eps) {
      Pol a;
      a.add(0, 0);
      a.add(sz1, 0);
      a.add(0, sz1);
      int aid = add(a);
      Pol aa;
      aa.add(sz / 2, sz / 2);
      aa.add(sz, sz);
      aa.add(0, sz);
      int aaid = add(aa);
      Pol b;
      b.add(sz1, 0);
      b.add(sz1, sz1);
      b.add(0, sz1);
      int bid = add(b);
      Pol bb;
      bb.add(sz, 0);
      bb.add(sz / 2, sz / 2);
      bb.add(0, 0);
      int bbid = add(bb);
      Pol c;
      c.add(0, 0);
      c.add(sz2, sz2);
      c.add(0, sz2);
      int cid = add(c);
      Pol cc;
      cc.add(sz, 0);
      cc.add(sz, sz);
      cc.add(sz / 2, sz / 2);
      int ccid = add(cc);
      Pol d;
      d.add(0, 0);
      d.add(sz2, 0);
      d.add(sz2, sz2);
      int did = add(d);
      Pol dd;
      dd.add(0, 0);
      dd.add(sz / 2, sz / 2);
      dd.add(0, sz);
      int ddid = add(dd);
      Pol e;
      e.add(0, 0);
      e.add(sz, 0);
      e.add(sz, sz);
      e.add(0, sz);
      int eid = add(e);
      ops.push_back(cutintotwo(id1, aid, bid));
      ops.push_back(cutintotwo(id2, cid, did));
      ops.push_back(move(aid, aaid));
      ops.push_back(move(bid, bbid));
      ops.push_back(move(cid, ccid));
      ops.push_back(move(did, ddid));
      ops.push_back(mergefour(aaid, bbid, ccid, ddid, eid));
      return eid;
    } else {
      double y = sz2 * (sz1 - sz2) / sz1;
      Pol a;
      a.add(sz2, 0);
      a.add(sz1, y);
      a.add(sz1, sz1);
      a.add(0, sz1);
      int aid = add(a);
      Pol b;
      b.add(0, 0);
      b.add(sz2, 0);
      b.add(0, sz1);
      int bid = add(b);
      Pol bb = b.translate(+sz1, +sz2);
      int bbid = add(bb);
      Pol c;
      c.add(sz2, 0);
      c.add(sz1, 0);
      c.add(sz1, y);
      int cid = add(c);
      Pol cc = c.translate(-sz2, +sz1);
      int ccid = add(cc);
      Pol d;
      d.add(0, y);
      d.add(sz2, sz2);
      d.add(0, sz2);
      int did = add(d);
      Pol dd = d.translate(+sz1, 0);
      int ddid = add(dd);
      Pol e;
      e.add(0, 0);
      e.add(sz2, 0);
      e.add(sz2, sz2);
      e.add(0, y);
      int eid = add(e);
      Pol ee = e.translate(sz1 - sz2, +sz1);
      int eeid = add(ee);
      Pol f;
      f.add(sz2, 0);
      f.add(sz1 + sz2, sz2);
      f.add(sz1, sz1 + sz2);
      f.add(0, sz1);
      int fid = add(f);
      Pol g;
      g.add(0, 0);
      g.add(sz, 0);
      g.add(sz, sz);
      g.add(0, sz);
      int gid = add(g);
      ops.push_back(cutintothree(id1, aid, bid, cid));
      ops.push_back(cutintotwo(id2, did, eid));
      ops.push_back(move(bid, bbid));
      ops.push_back(move(cid, ccid));
      ops.push_back(move(did, ddid));
      ops.push_back(move(eid, eeid));
      ops.push_back(mergefive(aid, bbid, ccid, ddid, eeid, fid));
      ops.push_back(move(fid, gid));
      return gid;
    }
  }
  vector<int> triangulate(int id) {
    vector<int> ret;
    vector<P> rem = pols[id].p;
    while (((int)(rem).size()) > 3) {
      bool found = false;
      for (int i = (0); i < (((int)(rem).size())); ++i) {
        P A = rem[(i + ((int)(rem).size()) - 1) % ((int)(rem).size())],
          B = rem[i], C = rem[(i + 1) % ((int)(rem).size())];
        if (side(A, B, C) <= 0) continue;
        bool ok = true;
        for (int j = (0); j < (((int)(rem).size()) - 3); ++j)
          if (inside(A, B, C, rem[(i + 2 + j) % ((int)(rem).size())])) {
            ok = false;
            break;
          }
        if (!ok) continue;
        rem.erase(rem.begin() + i);
        Pol a;
        a.add(A);
        a.add(B);
        a.add(C);
        ret.push_back(add(a));
        found = true;
        break;
      }
      assert(found);
    }
    Pol last;
    last.p = rem;
    ret.push_back(add(last));
    Op op;
    op.kind = 'S';
    op.full = id;
    op.parts = ret;
    ops.push_back(op);
    return ret;
  }
  int tosquare(int id) {
    if (pols[id].isrect()) return rect2square(id);
    if (pols[id].istri()) return rect2square(tri2rect(id));
    vector<int> tri = triangulate(id);
    int ret = rect2square(tri2rect(tri[0]));
    for (int i = (1); i < (((int)(tri).size())); ++i)
      ret = joinsquares(ret, rect2square(tri2rect(tri[i])));
    return ret;
  }
  void print() {
    for (int i = (0); i < (((int)(ops).size())); ++i) {
      if (ops[i].kind == 'S') {
        printf("cut ");
        pols[ops[i].full].print();
        printf(" into");
        for (int j = (0); j < (((int)(ops[i].parts).size())); ++j) {
          printf(" ");
          if (j != 0 && j == ((int)(ops[i].parts).size()) - 1) printf("and ");
          pols[ops[i].parts[j]].print();
        }
        puts("");
      }
      if (ops[i].kind == 'M') {
        printf("move");
        for (int j = (0); j < (((int)(ops[i].parts).size())); ++j) {
          printf(" ");
          if (j != 0 && j == ((int)(ops[i].parts).size()) - 1) printf("and ");
          pols[ops[i].parts[j]].print();
        }
        printf(" to ");
        pols[ops[i].full].print();
        puts("");
      }
      if (ops[i].kind == 'T') {
        printf("merge");
        for (int j = (0); j < (((int)(ops[i].parts).size())); ++j) {
          printf(" ");
          if (j != 0 && j == ((int)(ops[i].parts).size()) - 1) printf("and ");
          pols[ops[i].parts[j]].print();
        }
        printf(" into ");
        pols[ops[i].full].print();
        puts("");
      }
    }
  }
};
Pol a, b;
Sequence seqa, seqb;
Sequence ans;
vector<int> src;
void solve() {
  seqa.init();
  int aid = seqa.add(a);
  int said = seqa.tosquare(aid);
  seqb.init();
  int bid = seqb.add(b);
  int sbid = seqb.tosquare(bid);
  assert(seqa.pols[said] == seqb.pols[sbid]);
  ans.init();
  for (int i = (0); i < (((int)(seqa.pols).size())); ++i)
    ans.pols.push_back(seqa.pols[i]);
  for (int i = (0); i < (((int)(seqb.pols).size()) - 1); ++i)
    ans.pols.push_back(seqb.pols[i]);
  for (int i = (0); i < (((int)(seqa.ops).size())); ++i)
    ans.ops.push_back(seqa.ops[i]);
  for (int i = ((int)(seqb.ops).size()) - 1; i >= 0; --i) {
    Op op = seqb.ops[i];
    if (op.full != sbid)
      op.full += ((int)(seqa.pols).size());
    else
      op.full = said;
    for (int j = (0); j < (((int)(op.parts).size())); ++j)
      if (op.parts[j] != sbid)
        op.parts[j] += ((int)(seqa.pols).size());
      else
        op.parts[j] = sbid;
    if (op.kind == 'M') swap(op.full, op.parts[0]);
    if (op.kind == 'S')
      op.kind = 'T';
    else if (op.kind == 'T')
      op.kind = 'S';
    ans.ops.push_back(op);
  }
  int noutputid = 0;
  src = vector<int>(((int)(ans.pols).size()), -1);
  ans.pols[0].outputid = noutputid++;
  src[0] = 0;
  vector<Op> ops = ans.ops;
  ans.ops.clear();
  for (int i = (0); i < (((int)(ops).size())); ++i) {
    Op op = ops[i];
    if (op.kind == 'M') {
      assert(src[op.parts[0]] != -1);
      src[op.full] = src[op.parts[0]];
    }
    if (op.kind == 'S') {
      assert(src[op.full] != -1);
      if (src[op.full] != op.full) {
        ans.ops.push_back(move(src[op.full], op.full));
        ans.pols[op.full].outputid = noutputid++;
        src[op.full] = op.full;
      }
      for (int j = (0); j < (((int)(op.parts).size())); ++j) {
        ans.pols[op.parts[j]].outputid = noutputid++;
        src[op.parts[j]] = op.parts[j];
      }
      ans.ops.push_back(op);
    }
    if (op.kind == 'T') {
      for (int j = (0); j < (((int)(op.parts).size())); ++j)
        assert(src[op.parts[j]] != -1);
      ans.pols[op.full].outputid = noutputid++;
      src[op.full] = op.full;
      ans.ops.push_back(op);
    }
  }
}
void output(const Pol &pol) {
  printf("%d", ((int)(pol.p).size()));
  for (int i = (0); i < (((int)(pol.p).size())); ++i)
    printf(" %.15lf %.15lf", pol.p[i].x, pol.p[i].y);
  puts("");
}
void run() {
  a.p.clear();
  int na;
  scanf("%d", &na);
  for (int i = (0); i < (na); ++i) {
    double x, y;
    scanf("%lf%lf", &x, &y);
    a.add(x, y);
  }
  b.p.clear();
  int nb;
  scanf("%d", &nb);
  for (int i = (0); i < (nb); ++i) {
    double x, y;
    scanf("%lf%lf", &x, &y);
    b.add(x, y);
  }
  solve();
  for (int i = (0); i < (((int)(ans.ops).size())); ++i) {
    Op op = ans.ops[i];
    if (op.kind == 'M') {
      printf("tape\n");
      printf("1 %d\n", ans.pols[src[op.parts[0]]].outputid);
      output(ans.pols[op.full]);
      output(ans.pols[op.full]);
    }
    if (op.kind == 'S') {
      printf("scissors\n");
      printf("%d %d\n", ans.pols[op.full].outputid, ((int)(op.parts).size()));
      for (int j = (0); j < (((int)(op.parts).size())); ++j)
        output(ans.pols[op.parts[j]]);
    }
    if (op.kind == 'T') {
      printf("tape\n");
      printf("%d", ((int)(op.parts).size()));
      for (int j = (0); j < (((int)(op.parts).size())); ++j)
        printf(" %d", ans.pols[src[op.parts[j]]].outputid);
      puts("");
      for (int j = (0); j < (((int)(op.parts).size())); ++j)
        output(ans.pols[op.parts[j]]);
      output(ans.pols[op.full]);
    }
  }
}
void research() {
  Pol pol;
  for (int i = (0); i < (4); ++i) {
    double x, y;
    scanf("%lf%lf", &x, &y);
    pol.add(x, y);
  }
  Sequence seq;
  seq.pols.push_back(pol);
  int res = seq.rect2square(0);
  seq.print();
}
int main() {
  run();
  return 0;
}