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 debug_out(T t) {
  cerr << t;
}
template <typename A, typename B>
void debug_out(pair<A, B> u) {
  cerr << "(" << u.first << " " << u.second << ")";
}
template <typename T>
void debug_out(vector<T> t) {
  int sz = t.size();
  for (int i = 0; i < sz; i++) {
    debug_out(t[i]);
    if (i != sz - 1) cerr << ", ";
  }
}
template <typename T>
void debug_out(vector<vector<T>> t) {
  int sz = t.size();
  for (int i = 0; i < sz; i++) {
    debug_out(t[i]);
    if (i != sz - 1) cerr << endl;
  }
}
struct P {
  double x, y;
  P(){};
  P(double _x, double _y) : x(_x), y(_y){};
  P operator-(const P &b) const { return P{x - b.x, y - b.y}; }
  P operator+(const P &b) const { return P{x + b.x, y + b.y}; }
  P operator/(int a) { return P(x / a, y / a); }
  double operator*(const P &b) const { return x * b.y - y * b.x; }
  double cross(const P &b, const P &c) const {
    return (b - *this) * (c - *this);
  }
  bool isRight() const { return x > 0 || (x == 0 && y > 0); }
  bool operator<(const P &b) const {
    if (isRight() != b.isRight()) return isRight();
    return *this * b < 0;
  }
};
void debug_out(P a) { debug_out(make_pair(a.x, a.y)); }
struct L2 {
  P one, two;
  L2(){};
  L2(P _one, P _two) : one(_one), two(_two){};
  P dir() const { return two - one; }
  bool operator<(const L2 &b) const { return dir() < b.dir(); }
  long double get_coeff(const L2 &b) const {
    long double r = (b.dir() * (one - b.one)) / (long double)(dir() * b.dir());
    return r;
  }
  bool isParallel(const L2 &b) const { return dir() * b.dir() == 0; }
  P intersect(const L2 &b) const {
    long double r = get_coeff(b);
    return P(one.x + r * (two - one).x, one.y + r * (two - one).y);
  }
};
P pr(P a, L2 d) {
  P b = d.one - d.two;
  P c = a + P(-b.y, b.x);
  L2 e(a, c);
  return e.intersect(d);
}
double dis(P a, P b) {
  P c = a - b;
  return sqrt(c.x * c.x + c.y * c.y);
}
struct Poly {
  vector<P> vs;
  int n, id;
  Poly(){};
  Poly(vector<P> _vs, int _id = 0) : vs(_vs), id(_id) { n = vs.size(); }
  void read() {
    cin >> n;
    for (int i = 0; i < n; i++) {
      int x, y;
      cin >> x >> y;
      vs.emplace_back(x, y);
    }
  }
  Poly shift(int t) {
    vector<P> _vs(n);
    for (int i = 0; i < n; i++) {
      _vs[i] = vs[(i + t) % n];
    }
    return Poly(_vs);
  }
  Poly operator+(P a) {
    Poly u = *this;
    for (auto &i : u.vs) i = i + a;
    u.n = u.vs.size();
    return u;
  }
};
void debug_out(vector<Poly> a) {
  vector<vector<P>> _a(a.size());
  for (int i = 0; i < (int)a.size(); i++)
    for (auto j : a[i].vs) _a[i].push_back(j);
  debug_out(_a);
}
void debug_out(Poly a) { debug_out(a.vs); }
double S(Poly a) {
  double res = 0;
  for (int i = 0; i < a.n; i++) {
    res += a.vs[i] * a.vs[(i + 1) % a.n];
  }
  return abs(res / 2);
}
bool cross(P a, P b, P c, P d) {
  L2 u, v;
  u.one = a, u.two = b;
  v.one = c, v.two = d;
  if (u.isParallel(v)) return false;
  auto foo = u.intersect(v);
  double x = foo.x, y = foo.y;
  return x <= min(max(a.x, b.x), max(c.x, d.x)) &&
         x >= max(min(a.x, b.x), min(c.x, d.x)) &&
         y <= min(max(a.y, b.y), max(c.y, d.y)) &&
         y >= max(min(a.y, b.y), min(c.y, d.y));
};
const double inf = 1e7;
vector<Poly> triangulation(Poly u) {
  assert(u.n >= 3);
  vector<Poly> res;
  if (u.n == 3) {
    res.push_back(u);
    return res;
  }
  int a = -1, b = -1;
  for (int i = 0; i < u.n; i++) {
    for (int j = i + 1; j < u.n; j++) {
      if (i == (j + 1) % u.n || j == (i + 1) % u.n) continue;
      P to_inf = P(inf, inf * sqrt(2));
      P to = (u.vs[i] + u.vs[j]) / 2;
      bool bad = false;
      int cnt = 0;
      for (int x = 0; x < u.n; x++) {
        cnt ^= cross(to, to_inf, u.vs[x], u.vs[(x + 1) % u.n]);
        if (x == i || x == j || (x + 1) % u.n == i || (x + 1) % u.n == j)
          continue;
        bad |= cross(u.vs[i], u.vs[j], u.vs[x], u.vs[(x + 1) % u.n]);
      }
      if (!bad && cnt) {
        a = i;
        b = j;
        break;
      }
    }
    if (~a && ~b) break;
  }
  assert(~a && ~b);
  vector<P> l, r;
  for (int i = a; i <= b; i++) l.push_back(u.vs[i]);
  for (int i = b; i != (a + 1) % u.n; i = (i + 1) % u.n) r.push_back(u.vs[i]);
  vector<Poly> add = triangulation(Poly(r));
  res = triangulation(l);
  for (auto i : add) res.push_back(i);
  return res;
}
int cnt = 1;
int iter = 0;
struct query {
  int t;
  int k;
  vector<Poly> B;
  Poly A;
  query(){};
};
vector<query> res;
vector<Poly> cur;
vector<Poly> split(Poly a, vector<Poly> b) {
  query cc;
  cc.t = 0;
  cc.k = b.size();
  cc.A = a;
  for (Poly &u : b) {
    u.id = cnt++;
    cc.B.push_back(u);
    iter += u.n;
    cur.push_back(u);
  }
  res.push_back(cc);
  return b;
}
Poly joint(Poly a, vector<Poly> b) {
  a.id = cnt++;
  cur.push_back(a);
  query cc;
  cc.t = 1;
  cc.k = b.size();
  cc.A = a;
  for (Poly u : b) {
    cc.B.push_back(u);
  }
  res.push_back(cc);
  iter += a.n;
  return a;
}
Poly trans(Poly a, Poly b) {
  b.id = cnt++;
  cur.push_back(b);
  query cc;
  cc.t = 1;
  cc.k = 1;
  cc.A = b;
  cc.B.push_back(a);
  res.push_back(cc);
  iter += b.n;
  return b;
}
void out() {
  for (auto i : res) {
    if (!i.t) {
      printf("scissors\n");
      printf("%d %d\n", i.A.id, i.k);
      for (auto j : i.B) {
        printf("%d ", j.n);
        for (auto u : j.vs) printf("%.17g %.17g ", u.x, u.y);
        printf("\n");
      }
    } else {
      printf("tape\n");
      printf("%d ", i.k);
      for (auto j : i.B) printf("%d ", j.id);
      printf("\n");
      if (i.k == 1) {
        printf("%d ", i.A.n);
        for (auto j : i.A.vs) printf("%.17g %.17g ", j.x, j.y);
        printf("\n");
      } else {
        for (auto j : i.B) {
          printf("%d ", j.n);
          for (auto u : j.vs) printf("%.17g %.17g ", u.x, u.y);
          printf("\n");
        }
      }
      printf("%d ", i.A.n);
      for (auto j : i.A.vs) printf("%.17g %.17g ", j.x, j.y);
      printf("\n");
    }
  }
}
Poly rect(Poly s) {
  assert(s.n == 3);
  int mx = 0;
  double d = dis(s.vs[1], s.vs[2]);
  for (int i = 1; i < 3; i++) {
    if (dis(s.vs[(i + 1) % 3], s.vs[(i + 2) % 3]) > d) {
      mx = i;
      d = dis(s.vs[(i + 1) % 3], s.vs[(i + 2) % 3]);
    }
  }
  P a = s.vs[mx], b = s.vs[(mx + 1) % 3], c = s.vs[(mx + 2) % 3];
  Poly u, v;
  u.vs = {b, c, (c + a) / 2, (a + b) / 2};
  u.n = 4;
  v.vs = {a, (a + b) / 2, (a + c) / 2};
  v.n = 3;
  vector<Poly> foo = {u, v};
  foo = split(s, foo);
  u = foo[0], v = foo[1];
  Poly to;
  to.vs = {b, (a + b) / 2, (a + b - c + b) / 2};
  to.n = 3;
  to = trans(v, to);
  P p = pr(b, L2((a + b) / 2, (a + b - c + b) / 2));
  Poly l, r;
  l.vs = {b, (a + b) / 2, p};
  r.vs = {b, p, (a + b - c + b) / 2};
  l.n = 3, r.n = 3;
  vector<Poly> bar = {l, r};
  bar = split(to, bar);
  r = r + (c - b);
  r = trans(bar.back(), r);
  l = bar[0];
  Poly cc;
  cc.vs = {p, b, c, p + c - b};
  cc.n = 4;
  vector<Poly> sc = {u, l, r};
  cc = joint(cc, sc);
  Poly _cc;
  _cc.vs = {P(0, 0), P(dis(b, p), 0), P(dis(b, p), dis(b, c)), P(0, dis(b, c))};
  _cc.n = 4;
  _cc = trans(cc, _cc);
  return _cc;
}
Poly back_to_triangle(Poly s, Poly _cc) {
  assert(s.n == 3);
  int mx = 0;
  double d = dis(s.vs[1], s.vs[2]);
  for (int i = 1; i < 3; i++) {
    if (dis(s.vs[(i + 1) % 3], s.vs[(i + 2) % 3]) > d) {
      mx = i;
      d = dis(s.vs[(i + 1) % 3], s.vs[(i + 2) % 3]);
    }
  }
  P a = s.vs[mx], b = s.vs[(mx + 1) % 3], c = s.vs[(mx + 2) % 3];
  Poly u, v;
  u.vs = {b, c, (c + a) / 2, (a + b) / 2};
  u.n = 4;
  v.vs = {a, (a + b) / 2, (a + c) / 2};
  v.n = 3;
  Poly to;
  to.vs = {b, (a + b) / 2, (a + b - c + b) / 2};
  to.n = 3;
  P p = pr(b, L2((a + b) / 2, (a + b - c + b) / 2));
  Poly l, r;
  l.vs = {b, (a + b) / 2, p};
  r.vs = {b, p, (a + b - c + b) / 2};
  l.n = 3, r.n = 3;
  Poly cc;
  cc.vs = {p, b, c, p + c - b};
  cc.n = 4;
  cc = trans(_cc, cc);
  vector<Poly> sc = {u, l, r + (c - b)};
  sc = split(cc, sc);
  r = trans(sc.back(), r);
  l = sc[1];
  u = sc[0];
  sc = {r, l};
  to = joint(to, sc);
  v = trans(to, v);
  sc = {u, v};
  s = joint(s, sc);
  return s;
}
Poly x_fold(Poly a) {
  Poly u, v, to;
  u.vs = {(a.vs[0] + a.vs[3]) / 2, (a.vs[1] + a.vs[2]) / 2, a.vs[2], a.vs[3]};
  u.n = 4;
  v.vs = {a.vs[0], a.vs[1], (a.vs[1] + a.vs[2]) / 2, (a.vs[0] + a.vs[3]) / 2};
  v.n = 4;
  vector<Poly> foo = {u, v};
  foo = split(a, foo);
  u = foo[0], v = foo[1];
  u = trans(u, u + (u.vs[1] - u.vs[3]));
  to.vs = {v.vs[0], u.vs[1], u.vs[2], v.vs[3]};
  to.n = 4;
  foo.front() = u;
  return joint(to, foo);
}
Poly y_fold(Poly a) {
  Poly u, v, to;
  u.vs = {(a.vs[0] + a.vs[1]) / 2, a.vs[1], a.vs[2], (a.vs[2] + a.vs[3]) / 2};
  u.n = 4;
  v.vs = {a.vs[0], (a.vs[0] + a.vs[1]) / 2, (a.vs[2] + a.vs[3]) / 2, a.vs[3]};
  v.n = 4;
  vector<Poly> foo = {u, v};
  foo = split(a, foo);
  u = foo[0], v = foo[1];
  u = trans(u, u + (u.vs[3] - u.vs[1]));
  foo.front() = u;
  to.vs = {v.vs[0], v.vs[1], u.vs[2], u.vs[3]};
  to.n = 4;
  return joint(to, foo);
}
const double ze = 1e-5;
vector<double> near(Poly a) {
  return (vector<double>){a.vs[0].x - a.vs[3].x, a.vs[1].y - a.vs[0].y,
                          a.vs[2].x - a.vs[1].x, a.vs[3].y - a.vs[2].y};
}
Poly rectangle(Poly a, Poly b) {
  Poly u = a, v = b;
  double ux = dis(u.vs[0], u.vs[1]), uy = dis(u.vs[0], u.vs[3]);
  double vx = dis(v.vs[0], v.vs[1]), vy = dis(v.vs[0], v.vs[3]);
  vector<Poly> cons;
  while (vx > ze * 10) {
    while (ux > vx) {
      u = y_fold(u);
      ux /= 2;
      uy *= 2;
    }
    while (ux <= vx / 2) {
      u = x_fold(u);
      ux *= 2;
      uy /= 2;
    }
    if (abs(ux - vx) + abs(uy - vy) < ze) break;
    Poly from, _u, to, _v;
    from.vs = {P(0, 0), P(ux, 0), P(ux, vy), P(0, vy)};
    to = from + v.vs[0];
    from = from + u.vs[0];
    from.n = 4;
    to.n = 4;
    _u.vs = {from.vs[3], from.vs[2], u.vs[2], u.vs[3]};
    _u.n = 4;
    assert(ux < vx && uy > vy);
    assert(u.vs[2].y > from.vs[2].y);
    _v.vs = {to.vs[1], v.vs[1], v.vs[2], to.vs[2]};
    _v.n = 4;
    vector<Poly> l = {from, _u};
    l = split(u, l);
    assert(abs(S(from) + S(_u) - S(u)) < ze * 100);
    from = l[0], _u = l[1];
    to = trans(from, to);
    cons.push_back(to);
    if (_u.vs[0].y > 1e6) _u = trans(_u, _u + (P(0, 0) - u.vs[0]));
    v = _v;
    u = _u;
    ux = dis(u.vs[0], u.vs[1]), uy = dis(u.vs[0], u.vs[3]);
    vx = dis(v.vs[0], v.vs[1]), vy = dis(v.vs[0], v.vs[3]);
    u.vs = {P(0, 0), P(ux, 0), P(ux, uy), P(0, uy)};
    u.n = 4;
    v.vs = {P(0, 0), P(vx, 0), P(vx, vy), P(0, vy)};
    v.n = 4;
    u = u + _u.vs[0];
    v = v + _v.vs[0];
  }
  v = trans(u, u + (v.vs[0] - u.vs[0]));
  cons.push_back(v);
  return joint(b, cons);
}
void solve(Poly bar) {
  vector<Poly> r = triangulation(bar);
  r = split(bar, r);
  for (auto &i : r) i = rect(i);
  double sum = S(bar);
  double a = sqrt(sum);
  Poly to;
  to.vs = {P(0, 0), P(a, 0), P(a, a), P(0, a)};
  to.n = 4;
  vector<Poly> cc;
  double l = 0;
  for (auto i : r) {
    double len = S(i) / a;
    Poly ss;
    ss.n = 4;
    ss.vs = {P(l, 0), P(l + len, 0), P(l + len, a), P(l, a)};
    cc.push_back(rectangle(i, ss));
    l += len;
  }
  joint(to, cc);
}
void rev(Poly b, Poly sq) {
  vector<Poly> r = triangulation(b);
  int memo = cnt;
  auto foo = res;
  vector<Poly> ss;
  for (auto i : r) ss.push_back(rect(i));
  cnt = memo;
  swap(res, foo);
  double a = sqrt(S(sq));
  double l = 0;
  vector<Poly> sp;
  for (int i = 0; i < (int)ss.size(); i++) {
    double len = S(ss[i]) / a;
    vector<P> xs = {P(l, 0), P(l + len, 0), P(l + len, a), P(l, a)};
    sp.emplace_back(xs);
    l += len;
  }
  sp = split(sq, sp);
  for (int i = 0; i < (int)sp.size(); i++) {
    ss[i] = rectangle(sp[i], ss[i]);
    r[i] = back_to_triangle(r[i], ss[i]);
  }
  joint(b, r);
}
void debug_out(query a) {
  debug_out(a.t);
  cerr << endl;
  debug_out(a.A);
  cerr << endl;
  debug_out(a.k);
  cerr << endl;
  debug_out(a.B);
}
int main() {
  cerr.precision(15);
  Poly a, b;
  a.read();
  b.read();
  a.id = 0;
  solve(a);
  rev(b, res.back().A);
  out();
  return 0;
}