#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e4 + 10;
int n, q;
long double v[N][2], c[2];
int pid[2];
long double pin[2][2], _c[2];
long double dis(long double x0, long double y0, long double x1,
                long double y1) {
  return sqrt((x0 - x1) * (x0 - x1) + (y0 - y1) * (y0 - y1));
}
void getvtx(int p, int id, long double *ans) {
  long double x1 = c[0] - v[pid[p]][0], y1 = c[1] - v[pid[p]][1];
  long double x2 = _c[0] - pin[p][0], y2 = _c[1] - pin[p][1];
  long double theta = atan2(y2, x2) - atan2(y1, x1);
  if (theta > (atan(1.0) * 4))
    theta -= 2 * (atan(1.0) * 4);
  else if (theta < -(atan(1.0) * 4))
    theta += 2 * (atan(1.0) * 4);
  x1 = v[id][0] - v[pid[p]][0], y1 = v[id][1] - v[pid[p]][1];
  x2 = x1 * cos(theta) - y1 * sin(theta);
  y2 = x1 * sin(theta) + y1 * cos(theta);
  ans[0] = x2 + pin[p][0], ans[1] = y2 + pin[p][1];
}
void get_wp() {
  long double area = 0;
  for (int i = 2; i < n; i++) {
    long double tmp = (v[i][0] - v[1][0]) * (v[i][1] - v[i + 1][1]) -
                      (v[i][0] - v[i + 1][0]) * (v[i][1] - v[1][1]);
    c[0] += (v[1][0] + v[i][0] + v[i + 1][0]) / 3 * tmp;
    c[1] += (v[1][1] + v[i][1] + v[i + 1][1]) / 3 * tmp;
    area += tmp;
  }
  c[0] /= area;
  c[1] /= area;
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%Lf%Lf", v[i], v[i] + 1);
  get_wp();
  pid[0] = 1, pid[1] = 2;
  pin[0][0] = v[1][0], pin[0][1] = v[1][1];
  pin[1][0] = v[2][0], pin[1][1] = v[2][1];
  _c[0] = c[0], _c[1] = c[1];
  while (q--) {
    int opt, f, t, x;
    long double pp[2];
    scanf("%d", &opt);
    if (opt == 1) {
      scanf("%d%d", &f, &t);
      int ro = pid[0] == f;
      long double d = dis(pin[ro][0], pin[ro][1], _c[0], _c[1]);
      _c[0] = pin[ro][0], _c[1] = pin[ro][1] - d;
      pid[ro ^ 1] = t;
      getvtx(ro, t, pin[ro ^ 1]);
    } else {
      scanf("%d", &x);
      getvtx(0, x, pp);
      printf("%.8Lf %.8Lf\n", pp[0], pp[1]);
    }
  }
  return 0;
}
