Problem: Hag is a very talented person. He has always had an artist inside him but his father forced him to study mechanical engineering.

Yesterday he spent all of his time cutting a giant piece of wood trying to make it look like a goose. Anyway, his dad found out that he was doing arts rather than studying mechanics and other boring subjects. He confronted Hag with the fact that he is a spoiled son that does not care about his future, and if he continues to do arts he will cut his 25 Lira monthly allowance.

Hag is trying to prove to his dad that the wooden piece is a project for mechanics subject. He also told his dad that the wooden piece is a strictly convex polygon with n vertices.

Hag brought two pins and pinned the polygon with them in the 1-st and 2-nd vertices to the wall. His dad has q queries to Hag of two types. 

  * 1 f t: pull a pin from the vertex f, wait for the wooden polygon to rotate under the gravity force (if it will rotate) and stabilize. And then put the pin in vertex t. 
  * 2 v: answer what are the coordinates of the vertex v. 



Please help Hag to answer his father's queries.

You can assume that the wood that forms the polygon has uniform density and the polygon has a positive thickness, same in all points. After every query of the 1-st type Hag's dad tries to move the polygon a bit and watches it stabilize again.

Input

The first line contains two integers n and q (3≤ n ≤ 10 000, 1 ≤ q ≤ 200000) — the number of vertices in the polygon and the number of queries.

The next n lines describe the wooden polygon, the i-th line contains two integers x_i and y_i (|x_i|, |y_i|≤ 10^8) — the coordinates of the i-th vertex of the polygon. It is guaranteed that polygon is strictly convex and the vertices are given in the counter-clockwise order and all vertices are distinct.

The next q lines describe the queries, one per line. Each query starts with its type 1 or 2. Each query of the first type continues with two integers f and t (1 ≤ f, t ≤ n) — the vertex the pin is taken from, and the vertex the pin is put to and the polygon finishes rotating. It is guaranteed that the vertex f contains a pin. Each query of the second type continues with a single integer v (1 ≤ v ≤ n) — the vertex the coordinates of which Hag should tell his father.

It is guaranteed that there is at least one query of the second type.

Output

The output should contain the answer to each query of second type — two numbers in a separate line. Your answer is considered correct, if its absolute or relative error does not exceed 10^{-4}.

Formally, let your answer be a, and the jury's answer be b. Your answer is considered correct if \frac{|a - b|}{max{(1, |b|)}} ≤ 10^{-4}

Examples

Input

3 4
0 0
2 0
2 2
1 1 2
2 1
2 2
2 3


Output

3.4142135624 -1.4142135624
2.0000000000 0.0000000000
0.5857864376 -1.4142135624


Input

3 2
-1 1
0 0
1 1
1 1 2
2 1


Output

1.0000000000 -1.0000000000

Note

In the first test note the initial and the final state of the wooden polygon. 

<image>

Red Triangle is the initial state and the green one is the triangle after rotation around (2,0).

In the second sample note that the polygon rotates 180 degrees counter-clockwise or clockwise direction (it does not matter), because Hag's father makes sure that the polygon is stable and his son does not trick him.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int Q, N, M, K, L;
long double PX[10001], PY[10001], DEG[10001];
long double PPX[10001], PPY[10001];
long double com_x, com_y;
vector<int> A;
pair<long double, long double> Rotate(long double x, long double y,
                                      long double rad) {
  long double cosv = cos(rad);
  long double sinv = sin(rad);
  return make_pair(cosv * x - sinv * y, sinv * x + cosv * y);
}
pair<long double, long double> GetCenterRelativeToPolygon(int piv,
                                                          long double piv_x,
                                                          long double piv_y,
                                                          long double rot) {
  long double opiv_c_v_x = com_x - PX[piv];
  long double opiv_c_v_y = com_y - PY[piv];
  auto rot_c = Rotate(opiv_c_v_x, opiv_c_v_y, rot);
  return rot_c;
}
pair<long double, long double> GetPointRelativeToOrigin(int p, int piv,
                                                        long double piv_x,
                                                        long double piv_y,
                                                        long double rot) {
  auto rot_c = GetCenterRelativeToPolygon(piv, piv_x, piv_y, rot);
  rot_c.first += piv_x;
  rot_c.second += piv_y;
  long double ocp_v_x = PX[p] - com_x;
  long double ocp_v_y = PY[p] - com_y;
  auto rot_ocp_v = Rotate(ocp_v_x, ocp_v_y, rot);
  return make_pair(rot_c.first + rot_ocp_v.first,
                   rot_c.second + rot_ocp_v.second);
}
int main() {
  long double area = 0;
  cin >> N >> Q;
  for (int i = 0; i < N; i++) {
    cin >> PX[i] >> PY[i];
    PPX[i] = PX[i];
    PPY[i] = PY[i];
    PX[i] -= PPX[0];
    PY[i] -= PPY[0];
  }
  if (N == 3) {
    area = abs((PX[1] - PX[0]) * (PY[2] - PY[0]) -
               (PX[2] - PX[0]) * (PY[1] - PY[0])) /
           2;
    com_x = (PX[0] + PX[1] + PX[2]) / 3;
    com_y = (PY[0] + PY[1] + PY[2]) / 3;
  } else {
    for (int i = 0; i < N; i++) {
      int a = i;
      int b = (i + 1) % N;
      area += PX[a] * PY[b] - PX[b] * PY[a];
      com_x += (PX[a] + PX[b]) * (PX[a] * PY[b] - PX[b] * PY[a]);
      com_y += (PY[a] + PY[b]) * (PX[a] * PY[b] - PX[b] * PY[a]);
    }
    area /= 2;
    com_x /= (6 * area);
    com_y /= (6 * area);
  }
  for (int i = 0; i < N; i++) {
    long double vx = PX[i] - com_x;
    long double vy = PY[i] - com_y;
    long double deg = atan2(vy, vx);
    DEG[i] = deg;
  }
  cout.precision(9);
  map<int, pair<long double, long double> > pin;
  pin[0] = {PPX[0], PPY[0]};
  pin[1] = {PPX[1], PPY[1]};
  long double rot = 0;
  for (int q = 0; q < Q; q++) {
    int a, b, c;
    cin >> a >> b;
    if (a == 1) {
      cin >> c;
      b--;
      c--;
      if (pin.size() > 1) pin.erase(b);
      auto cur = *pin.begin();
      auto cur_center = GetCenterRelativeToPolygon(cur.first, cur.second.first,
                                                   cur.second.second, rot);
      long double cur_rot = atan2(cur_center.second, cur_center.first);
      long double yaxis = atan2(-1, 0);
      long double add_rot = yaxis - cur_rot;
      rot += add_rot;
      auto point =
          GetPointRelativeToOrigin(c, cur.first, pin.begin()->second.first,
                                   pin.begin()->second.second, rot);
      pin[c] = point;
    } else {
      b--;
      auto cur = *pin.begin();
      auto point = GetPointRelativeToOrigin(b, cur.first, cur.second.first,
                                            cur.second.second, rot);
      cout << fixed << point.first << " " << point.second << endl;
    }
  }
  cin >> N;
}