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;
struct Point {
  long double x, y;
  Point() {}
  Point(long double x, long double y) : x(x), y(y) {}
  Point(const Point &p) : x(p.x), y(p.y) {}
  Point operator+(const Point &p) const { return Point(x + p.x, y + p.y); }
  Point operator-(const Point &p) const { return Point(x - p.x, y - p.y); }
  Point operator*(long double c) const { return Point(x * c, y * c); }
  Point operator/(long double c) const {
    assert(fabs(c) > eps);
    return Point(x / c, y / c);
  }
};
long double dot(Point p, Point q) { return p.x * q.x + p.y * q.y; }
long double cross(Point p, Point q) { return p.x * q.y - p.y * q.x; }
long double dist(Point p, Point q) {
  return sqrt(
      (long double)((p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y)));
}
ostream &operator<<(ostream &os, const Point &p) {
  os << "(" << p.x << "," << p.y << ")";
}
bool operator<(const Point &a, const Point &b) {
  return make_pair(a.x, a.y) < make_pair(b.x, b.y);
}
bool operator==(const Point &a, const Point &b) {
  return (fabs(a.x - b.x) < eps) && (fabs(a.y - b.y) < eps);
}
Point RotateCCW90(Point p) { return Point(-p.y, p.x); }
Point RotateCW90(Point p) { return Point(p.y, -p.x); }
Point RotateCCW(Point p, long double t) {
  return Point(p.x * cos(t) - p.y * sin(t), p.x * sin(t) + p.y * cos(t));
}
Point ProjectPointLine(Point a, Point b, Point c) {
  return a + (b - a) * dot(c - a, b - a) / dot(b - a, b - a);
}
Point ProjectPointSegment(Point a, Point b, Point c) {
  long double r = dot(b - a, b - a);
  if (fabs(r) < eps) return a;
  r = dot(c - a, b - a) / r;
  if (r < 0) return a;
  if (r > 1) return b;
  return a + (b - a) * r;
}
long double DistancePointLine(Point a, Point b, Point c) {
  return dist(c, ProjectPointLine(a, b, c));
}
long double DistancePointPlane(long double x, long double y, long double z,
                               long double a, long double b, long double c,
                               long double d) {
  return fabs(a * x + b * y + c * z - d) / sqrt(a * a + b * b + c * c);
}
bool LinesParallel(Point a, Point b, Point c, Point d) {
  return fabs(cross(b - a, c - d)) < eps;
}
bool LinesCollinear(Point a, Point b, Point c, Point d) {
  return LinesParallel(a, b, c, d) && fabs(cross(a - b, a - c)) < eps &&
         fabs(cross(c - d, c - a)) < eps;
}
bool SegmentsIntersect(Point a, Point b, Point c, Point d) {
  if (LinesCollinear(a, b, c, d)) {
    if (dist(a, c) < eps || dist(a, d) < eps || dist(b, c) < eps ||
        dist(b, d) < eps)
      return true;
    if (dot(c - a, c - b) > 0 && dot(d - a, d - b) > 0 &&
        dot(b - c, b - d) > 0 && dot(b - c, b - d) > 0)
      return false;
    return true;
  }
  if (cross(d - a, b - a) * cross(c - a, b - a) > 0) return false;
  if (cross(a - c, d - c) * cross(b - c, d - c) > 0) return false;
  return true;
}
Point ComputeLineIntersection(Point a, Point b, Point c, Point d) {
  b = b - a;
  d = c - d;
  c = c - a;
  assert(dot(b, b) > eps && dot(d, d) > eps);
  return a + b * cross(c, d) / cross(b, d);
}
Point ComputeCircleCenter(Point a, Point b, Point c) {
  b = (a + b) / 2;
  c = (a + c) / 2;
  return ComputeLineIntersection(b, b + RotateCW90(a - b), c,
                                 c + RotateCW90(a - c));
}
vector<Point> CircleLineIntersection(Point a, Point b, Point c, long double r) {
  vector<Point> ret;
  b = b - a;
  a = a - c;
  long double A = dot(b, b);
  long double B = dot(a, b);
  long double C = dot(a, a) - r * r;
  long double D = B * B - A * C;
  if (D < -eps) return ret;
  ret.push_back(c + a + b * (-B + sqrt(D + eps)) / A);
  if (D > eps) ret.push_back(c + a + b * (-B - sqrt(D)) / A);
  return ret;
}
vector<Point> CircleCircleIntersection(Point a, Point b, long double r,
                                       long double R) {
  vector<Point> ret;
  long double d = dist(a, b);
  if (d > r + R || d + min(r, R) < max(r, R)) return ret;
  long double x = (d * d - R * R + r * r) / (2 * d);
  long double y = sqrt(r * r - x * x);
  Point v = (b - a) / d;
  ret.push_back(a + v * x + RotateCCW90(v) * y);
  if (y > 0) ret.push_back(a + v * x - RotateCCW90(v) * y);
  return ret;
}
bool PointInPolygon(const vector<Point> &p, Point q) {
  bool c = 0;
  for (int i = 0; i < p.size(); i++) {
    int j = (i + 1) % p.size();
    if ((p[i].y <= q.y && q.y < p[j].y || p[j].y <= q.y && q.y < p[i].y) &&
        q.x < p[i].x + (p[j].x - p[i].x) * (q.y - p[i].y) / (p[j].y - p[i].y))
      c = !c;
  }
  return c;
}
bool PointOnPolygon(const vector<Point> &p, Point q) {
  for (int i = 0; i < p.size(); i++) {
    if (dist(ProjectPointSegment(p[i], p[(i + 1) % p.size()], q), q) < eps)
      return true;
  }
  return false;
}
long double ComputeSignedArea(const vector<Point> &p) {
  long double area = 0;
  for (int i = 0; i < p.size(); i++) {
    int j = (i + 1) % p.size();
    area += p[i].x * p[j].y - p[j].x * p[i].y;
  }
  return area / 2.0;
}
long double ComputeArea(const vector<Point> &p) {
  return fabs(ComputeSignedArea(p));
}
bool IsSimple(const vector<Point> &p) {
  for (int i = 0; i < p.size(); i++) {
    for (int k = i + 1; k < p.size(); k++) {
      int j = (i + 1) % p.size();
      int l = (k + 1) % p.size();
      if (i == l || j == k) continue;
      if (SegmentsIntersect(p[i], p[j], p[k], p[l])) return false;
    }
  }
  return true;
}
long double area2(Point a, Point b, Point c) { return cross(b - a, c - a); }
bool in_convex(vector<Point> &l, Point p) {
  int a = 1, b = l.size() - 1, c;
  if (((l[a].x - l[0].x) * (l[b].y - l[0].y) -
       (l[a].y - l[0].y) * (l[b].x - l[0].x)) > 0)
    swap(a, b);
  if (((l[a].x - l[0].x) * (p.y - l[0].y) -
       (l[a].y - l[0].y) * (p.x - l[0].x)) >= 0 ||
      ((l[b].x - l[0].x) * (p.y - l[0].y) -
       (l[b].y - l[0].y) * (p.x - l[0].x)) <= 0)
    return false;
  while (abs(a - b) > 1) {
    c = (a + b) / 2;
    if (((l[c].x - l[0].x) * (p.y - l[0].y) -
         (l[c].y - l[0].y) * (p.x - l[0].x)) > 0)
      b = c;
    else
      a = c;
  }
  return ((l[b].x - l[a].x) * (p.y - l[a].y) -
          (l[b].y - l[a].y) * (p.x - l[a].x)) <= 0;
}
long double ori(Point a, Point b, Point c) {
  b = b - a;
  c = c - a;
  return cross(b, c);
}
bool remove_last_eql_hull_pt = true;
vector<Point> convexHull(vector<Point> P) {
  sort(P.begin(), P.end());
  P.erase(unique(P.begin(), P.end()), P.end());
  int n = P.size(), k = 0;
  vector<Point> H(2 * n);
  for (int i = 0; i < n; i++) {
    while (k >= 2 and ori(H[k - 2], H[k - 1], P[i]) <= 0) k--;
    H[k] = P[i];
    k++;
  }
  int t = k + 1;
  for (int i = n - 2; i >= 0; i--) {
    while (k >= t and ori(H[k - 2], H[k - 1], P[i]) <= 0) k--;
    H[k] = P[i];
    k++;
  }
  if (!remove_last_eql_hull_pt)
    H.resize(k);
  else {
    if (k >= 2)
      H.resize(k - 1);
    else
      H.resize(k);
  }
  return H;
}
vector<Point> pts;
bool LexCmp(const Point &a, const Point &b) {
  if (fabs(a.x - b.x) > eps) return a.x < b.x;
  return a.y < b.y;
}
bool LexCmp2(const Point &a, const Point &b) {
  if (fabs(a.y - b.y) > eps) return a.y < b.y;
  return a.x < b.x;
}
void Prepare() { sort(pts.begin(), pts.end(), LexCmp); }
long double FindCP(int l, int r) {
  if (l >= r) return LDBL_MAX;
  int mid = (l + r) >> 1;
  long double ll = FindCP(l, mid);
  long double rr = FindCP(mid + 1, r);
  long double ans = min(ll, rr);
  long double dis = ans;
  vector<Point> lft, rgt;
  long double xmid = (pts[mid].x + pts[mid + 1].x) / 2;
  for (int i = l; i <= mid; i++) {
    if (xmid - pts[i].x <= ans + eps) lft.push_back(pts[i]);
  }
  for (int i = mid + 1; i <= r; i++) {
    if (pts[i].x - xmid <= ans + eps) rgt.push_back(pts[i]);
  }
  sort(lft.begin(), lft.end(), LexCmp2);
  sort(rgt.begin(), rgt.end(), LexCmp2);
  int dwn = 0, up = 0;
  for (int i = 0; i < lft.size(); i++) {
    while (up + 1 < rgt.size() && rgt[up + 1].y - lft[i].y <= dis) {
      up++;
    }
    while (dwn < rgt.size() && lft[i].y - rgt[dwn].y > dis) dwn++;
    for (int j = dwn; j <= up; j++) {
      ans = min(ans, dist(lft[i], rgt[j]));
    }
  }
  return ans;
}
long double ClosestPair() {
  Prepare();
  return FindCP(0, pts.size() - 1);
}
Point ComputeCentroid(vector<Point> p) {
  Point c(0, 0);
  Point temp = p[0];
  for (int i = 0; i < p.size(); i++) p[i] = p[i] - temp;
  long double scale = 6.0 * ComputeSignedArea(p);
  for (int i = 0; i < p.size(); i++) {
    int j = (i + 1) % p.size();
    c = c + (p[i] + p[j]) * (p[i].x * p[j].y - p[j].x * p[i].y);
  }
  Point tem = c / scale;
  return tem + temp;
}
int n, q, f, s;
Point pf, ps, pc;
vector<Point> pol;
long double dis[10005], ang[10005];
const long double pi = 2.0 * acos(0);
long double calc(Point temp, long double r) {
  long double theta = acos(fabs(temp.x / r));
  if (temp.x >= 0 and temp.y >= 0)
    return theta;
  else if (temp.x >= 0 and temp.y <= 0)
    return 2.0 * pi - theta;
  else if (temp.x <= 0 and temp.y >= 0)
    return pi - theta;
  else if (temp.x <= 0 and temp.y <= 0)
    return pi + theta;
}
Point getPoint(Point cen, int v, Point ref, int u) {
  if (v == u) return ref;
  long double temp = calc(ref - cen, dist(ref, cen));
  long double rot = temp - ang[u];
  Point tem(dis[v] * cos(ang[v] + rot), dis[v] * sin(ang[v] + rot));
  return tem + cen;
}
Point newCentroid(Point ref, Point oldCentroid) {
  Point temp(ref);
  temp.y -= dist(ref, oldCentroid);
  return temp;
}
int main() {
  ios_base::sync_with_stdio(false);
  int precision = numeric_limits<long double>::digits10;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    Point p;
    cin >> p.x >> p.y;
    pol.push_back(p);
  }
  f = 1;
  s = 2;
  pf = pol[0];
  ps = pol[1];
  pc = ComputeCentroid(pol);
  for (int i = 1; i <= n; i++) {
    dis[i] = dist(pc, pol[i - 1]);
    Point temp = pol[i - 1] - pc;
    ang[i] = calc(temp, dis[i]);
  }
  for (int i = 1; i <= q; i++) {
    int t, u, v;
    cin >> t;
    if (t == 1) {
      cin >> u >> v;
      if (u == f) {
        Point temp = newCentroid(ps, pc);
        pc = temp;
        f = v;
        pf = getPoint(pc, v, ps, s);
      } else if (u == s) {
        Point temp = newCentroid(pf, pc);
        pc = temp;
        s = v;
        ps = getPoint(pc, v, pf, f);
      }
    } else {
      cin >> v;
      Point temp = getPoint(pc, v, pf, f);
      cout << setprecision(precision);
      cout << temp.x << " " << temp.y << "\n";
    }
  }
}