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 int oo = 2139063143;
const int N = 1010000;
const int P = 1000000007;
const long double eps = 1e-7;
template <typename T>
inline void sc(T &x) {
  x = 0;
  static int p;
  p = 1;
  static char c;
  c = getchar();
  while (!isdigit(c)) {
    if (c == '-') p = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c - 48);
    c = getchar();
  }
  x *= p;
}
template <typename T>
inline void print(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
inline void pr(T x) {
  print(x), putchar('\n');
}
template <typename T1, typename T2>
void chkmax(T1 &A, T2 B) {
  A = A >= B ? A : B;
}
template <typename T1, typename T2>
void chkmin(T1 &A, T2 B) {
  A = A <= B ? A : B;
}
const long double PI = acos(-1);
int n, m;
struct po {
  long double x, y;
  po(long double xx = 0, long double yy = 0) { x = xx, y = yy; }
} a[N], s[N];
po operator+(po A, po B) { return po(A.x + B.x, A.y + B.y); }
po operator-(po A, po B) { return po(A.x - B.x, A.y - B.y); }
long double operator*(po A, po B) { return A.x * B.y - A.y * B.x; }
po operator*(po A, long double B) { return po(A.x * B, A.y * B); }
po operator*(long double B, po A) { return po(A.x * B, A.y * B); }
long double triangle(po A, po B, po C) { return abs((B - A) * (C - A)) / 2; }
long double area() {
  long double g = a[n] * a[1];
  for (int i = 1; i < n; i++) g += a[i] * a[i + 1];
  return abs(g) / 2;
}
po core(po A, po B, po C) { return (A + B + C) * (1. / 3); }
po O;
void core() {
  long double S = area();
  for (int i = 2; i < n; i++)
    O = O + (triangle(a[1], a[i], a[i + 1]) / S) * core(a[1], a[i], a[i + 1]);
}
long double S(long double A) { return A * A; }
long double getlen(po A) { return sqrt(S(A.x) + S(A.y)); }
long double len[N], b[N];
long double atan2(po A) { return atan2(A.y, A.x); }
po rotate(po A, long double x) {
  long double s = sin(x), c = cos(x);
  return po(A.x * c - A.y * s, A.x * s + A.y * c);
}
int ia = 1, ib = 2;
po A, B, p;
po getpos(int i) { return O + rotate(s[i], b[0] - b[ia]); }
int main() {
  sc(n), sc(m);
  for (int i = 1; i <= n; i++) {
    int x, y;
    sc(x), sc(y);
    a[i] = po(x, y);
  }
  core();
  for (int i = 1; i <= n; i++)
    s[i] = a[i] - O, len[i] = getlen(s[i]), b[i] = atan2(s[i]);
  b[0] = atan2(po(0, 1));
  A = a[1], B = a[2];
  bool fg = 0;
  while (m--) {
    int op, x, y;
    sc(op), sc(x);
    if (op == 1) {
      sc(y);
      if (ia == x) swap(ia, ib), swap(A, B);
      O = po(A.x, A.y - len[ia]);
      ib = y, B = getpos(ib);
      fg = 1;
    } else {
      if (fg)
        p = getpos(x), printf("%.9Lf %.9Lf\n", p.x, p.y);
      else
        printf("%.9Lf %.9Lf\n", a[x].x, a[x].y);
    }
  }
  return 0;
}