#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:536870912")
#pragma warning(disable : 4996)
using namespace std;
const int N = 1e4 + 100;
double x[N], y[N], d[N], g[N];
void rot(long double &x, long double &y, int i, long double a) {
  x = d[i] * cosl(a);
  y = d[i] * sinl(a);
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) {
    scanf("%lf%lf", &x[i], &y[i]);
  }
  double cx = 0, cy = 0, sq = 0;
  for (int i = 1; i < n - 1; i++) {
    double s = abs((x[i] - x[0]) * (y[i + 1] - y[0]) -
                   (x[i + 1] - x[0]) * (y[i] - y[0]));
    sq += s;
    cx += (x[i] + x[i + 1] + x[0]) * s;
    cy += (y[i] + y[i + 1] + y[0]) * s;
  }
  cx = cx / (3 * sq);
  cy = cy / (3 * sq);
  for (int i = 0; i < n; i++) {
    x[i] -= cx;
    y[i] -= cy;
    d[i] = sqrtl(x[i] * x[i] + y[i] * y[i]);
    g[i] = atan2l(y[i], x[i]);
    if (g[i] < 0) g[i] += 2 * 3.1415926535897932384626433832795;
  }
  int t[2] = {0, 1};
  long double ang = 0;
  while (q--) {
    int tp, a, b;
    scanf("%d", &tp);
    if (tp == 1) {
      scanf("%d%d", &a, &b);
      a--, b--;
      int p = t[0] != a ? 0 : 1;
      t[1 - p] = b;
      p = t[p];
      long double rx, ry;
      rot(rx, ry, p, ang + g[p]);
      long double w = 3.1415926535897932384626433832795 / 2 - ang - g[p],
                  len = sqrtl(rx * rx + ry * ry), h = atan2l(-ry, -rx) + w;
      cx = len * cosl(h) + rx + cx;
      cy = len * sinl(h) + ry + cy;
      ang += w;
      while (ang > 2 * 3.1415926535897932384626433832795)
        ang -= 2 * 3.1415926535897932384626433832795;
      while (ang < 0) ang += 2 * 3.1415926535897932384626433832795;
    } else {
      scanf("%d", &a);
      a--;
      long double ax, ay;
      rot(ax, ay, a, ang + g[a]);
      printf("%.10f %.10f\n", (double)(ax + cx), (double)(ay + cy));
    }
  }
  return 0;
}
