#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
struct point {
  double x, y;
  point() {
    x = 0;
    y = 0;
  }
  point operator+(point b) {
    b.x = b.x + x;
    b.y = b.y + y;
    return b;
  }
  point operator-(point b) {
    b.x = x - b.x;
    b.y = y - b.y;
    return b;
  }
  point operator*(point b) {
    b.x = x * b.x;
    b.y = y * b.y;
    return b;
  }
  point operator*(double b) {
    point pt;
    pt.x = x * b;
    pt.y = y * b;
    return pt;
  }
  double dot(point b) { return x * b.x + y * b.y; }
  double det(point b) { return x * b.y - y * b.x; }
  point operator/(double t) {
    point pt;
    pt.x = x / t;
    pt.y = y / t;
    return pt;
  }
  double mo() { return x * x + y * y; }
};
int now;
int p[2];
point pos[N], z, zb[2], vecon, zx, tp, ans, t, cx[N];
int n, q, dd, u, v;
double x, y;
double s[N], sall;
bool flag;
int op;
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) {
    scanf("%lf%lf", &x, &y);
    pos[i].x = (double)x;
    pos[i].y = (double)y;
  }
  z.x = 0;
  z.y = 0;
  sall = 0;
  for (int i = 1; i < n - 1; i++) {
    cx[i] = (pos[0] + pos[i] + pos[i + 1]) / 3;
    s[i] = (pos[i] - pos[0]).det(pos[i + 1] - pos[0]);
    z = z * (sall / (sall + s[i])) + cx[i] * (s[i] / (sall + s[i]));
    sall += s[i];
  }
  zb[0] = pos[0];
  zb[1] = pos[1];
  p[0] = 0;
  p[1] = 1;
  now = 0;
  flag = 0;
  for (int i = 1; i <= q; i++) {
    scanf("%d", &op);
    if (op == 2) {
      scanf("%d", &dd);
      dd--;
      if (!flag)
        printf("%.13f %.13f\n", (double)pos[dd].x, (double)pos[dd].y);
      else {
        t = pos[p[now]] - z;
        tp = pos[dd] - z;
        vecon.x = 0;
        vecon.y = sqrtl(t.mo());
        zx = zb[now] - vecon;
        ans.x = zx.x * vecon.mo() + tp.x * t.dot(vecon) - tp.y * t.det(vecon);
        ans.x /= vecon.mo();
        ans.y = zx.y * vecon.mo() + tp.x * t.det(vecon) + tp.y * t.dot(vecon);
        ans.y /= vecon.mo();
        printf("%.13f %.13f\n", (double)ans.x, (double)ans.y);
      }
    } else {
      flag = 1;
      scanf("%d%d", &u, &v);
      u--;
      v--;
      for (int j = 0; j < 2; j++)
        if (p[j] == u) {
          now = j ^ 1;
          p[j] = v;
          break;
        }
      t = pos[p[now]] - z;
      tp = pos[p[now ^ 1]] - z;
      vecon.x = 0;
      vecon.y = sqrtl(t.mo());
      zx = zb[now] - vecon;
      zb[now ^ 1].x =
          zx.x * vecon.mo() + tp.x * t.dot(vecon) - tp.y * t.det(vecon);
      zb[now ^ 1].x /= vecon.mo();
      zb[now ^ 1].y =
          zx.y * vecon.mo() + tp.x * t.det(vecon) + tp.y * t.dot(vecon);
      zb[now ^ 1].y /= vecon.mo();
    }
  }
  return 0;
}
