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;
const long double eps = 1e-9;
const long double PI = acos(-1.0);
inline int sgn(long double x) { return x < -eps ? -1 : (x > eps ? 1 : 0); }
struct pt {
  long double x, y;
  pt() {}
  pt(long double _x, long double _y) : x(_x), y(_y) {}
  pt operator+(const pt& p) const { return pt(x + p.x, y + p.y); }
  pt operator-(const pt& p) const { return pt(x - p.x, y - p.y); }
  pt operator*(long double d) const { return pt(x * d, y * d); }
  pt operator/(long double d) const { return pt(x / d, y / d); }
  long double cross(const pt& p) const { return x * p.y - y * p.x; }
  long double cross(const pt& p, const pt& q) const {
    return (p - *this).cross(q - *this);
  }
  long double dot(const pt& p) const { return x * p.x + y * p.y; }
  long double dot(const pt& p, const pt& q) const {
    return (p - *this).dot(q - *this);
  }
  long double angle() const { return atan2(y, x); }
};
struct query {
  int tp;
  int x, y;
};
struct rotation {
  pt cen;
  long double cs, si;
  pt apply(const pt& p) const {
    long double x = p.x - cen.x, y = p.y - cen.y;
    return pt(cen.x + x * cs - y * si, cen.y + x * si + y * cs);
  }
};
const int N = (int)2e5 + 5;
const int BLOCK = 400;
int n, q;
int sum = 1;
pt p[N];
pt center;
rotation rot[BLOCK];
pt cenpos[BLOCK];
void process_queries(vector<query> qs) {
  int sz = qs.size();
  for (size_t i = 0; i < qs.size(); i++) {
    auto pos = p[qs[i].tp == 1 ? sum - qs[i].x : qs[i].x];
    for (size_t j = 0; j < i; j++) {
      if (qs[j].tp == 1) pos = rot[j].apply(pos);
    }
    if (qs[i].tp == 1) {
      long double angle = -PI / 2 - (center - pos).angle();
      rot[i] = rotation{pos, cos(angle), sin(angle)};
      center = rot[i].apply(center);
      sum = sum - qs[i].x + qs[i].y;
    } else {
      cout << fixed << pos.x << ' ' << pos.y << '\n';
    }
  }
  long double A[2][2], c[2];
  A[0][0] = A[1][1] = 1;
  A[0][1] = A[1][0] = 0;
  c[0] = c[1] = 0;
  for (size_t j = 0; j < qs.size(); j++) {
    if (qs[j].tp == 1) {
      long double B[2][2], d[2];
      B[0][0] = A[0][0] * rot[j].cs - A[1][0] * rot[j].si;
      B[0][1] = A[0][1] * rot[j].cs - A[1][1] * rot[j].si;
      B[1][0] = A[0][0] * rot[j].si + A[1][0] * rot[j].cs;
      B[1][1] = A[0][1] * rot[j].si + A[1][1] * rot[j].cs;
      d[0] = rot[j].cen.x + rot[j].cs * (c[0] - rot[j].cen.x) -
             rot[j].si * (c[1] - rot[j].cen.y);
      d[1] = rot[j].cen.y + rot[j].si * (c[0] - rot[j].cen.x) +
             rot[j].cs * (c[1] - rot[j].cen.y);
      memcpy(A, B, sizeof(A));
      memcpy(c, d, sizeof(c));
    }
  }
  for (int i = 0; i < n; i++) {
    long double x = A[0][0] * p[i].x + A[0][1] * p[i].y + c[0];
    long double y = A[1][0] * p[i].x + A[1][1] * p[i].y + c[1];
    p[i] = pt(x, y);
  }
}
void solve() {
  cout.precision(12);
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    p[i] = pt(x, y);
  }
  long double area = 0;
  for (int i = 0; i < n; i++) area += p[i].cross(p[(i + 1) % n]);
  area = fabs(area);
  for (int i = 1; i + 1 < n; i++) {
    pt curr = (p[i] + p[i + 1] + p[0]) / 3;
    center = center + curr * fabs(p[0].cross(p[i], p[i + 1]));
  }
  center = center / area;
  vector<query> qs;
  for (int i = 0; i < q; i++) {
    if ((int)qs.size() == BLOCK) {
      process_queries(qs);
      qs = {};
    }
    query curr;
    cin >> curr.tp >> curr.x;
    if (curr.tp == 1) cin >> curr.y;
    --curr.x;
    --curr.y;
    qs.push_back(curr);
  }
  process_queries(qs);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int T = 1;
  while (T--) solve();
  return 0;
}