#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e4 + 5;
const double eps = 1e-8;
const double pi = acos(-1);
inline int sgn(double x) {
  if (x < -eps)
    return -1;
  else if (x > eps)
    return 1;
  else
    return 0;
}
struct Point {
  double x, y;
  Point(double _x = 0.0, double _y = 0.0) : x(_x), y(_y) {}
  Point operator+(const Point &b) const { return Point(x + b.x, y + b.y); }
  Point operator-(const Point &b) const { return Point(x - b.x, y - b.y); }
  double operator^(const Point &b) const { return (x * b.y - y * b.x); }
  Point operator*(double b) { return Point(x * b, y * b); }
  Point rot(double ang) {
    return Point(x * cos(ang) - y * sin(ang), x * sin(ang) + y * cos(ang));
  }
};
double angle(Point vA, Point vB) {
  double ang_1 = atan2(vA.y, vA.x);
  double ang_2 = atan2(vB.y, vB.x);
  ang_2 -= ang_1;
  if (sgn(ang_2) == -1) ang_2 += pi * 2.0;
  return ang_2;
}
Point p[maxn], pt, pr, qt, qr, e;
int main() {
  int n, q, i, j, op, u = 1, v = 2;
  double c = 0, ss = 0;
  scanf("%d%d", &n, &q);
  for (i = 1; i <= n; i++) scanf("%lf%lf", &p[i].x, &p[i].y);
  for (i = 2; i < n; i++) {
    double s = fabs((p[i] - p[1]) ^ (p[i + 1] - p[1]));
    ss += s;
    pt = pt + (p[1] + p[i] + p[i + 1]) * (s / 3.0);
  }
  qt = pt = pt * (1.0 / ss);
  qr = pr = p[1];
  while (q--) {
    scanf("%d", &op);
    if (op == 1) {
      scanf("%d%d", &i, &j);
      if (u != i) swap(u, v);
      e = (p[v] - pt).rot(c) + qt;
      c = angle(qt - e, Point(0, -1));
      qt = (qt - e).rot(c) + e;
      qr = (qr - e).rot(c) + e;
      c = angle(pr - pt, qr - qt);
      u = j;
    } else {
      scanf("%d", &i);
      e = (p[i] - pt).rot(c) + qt;
      printf("%.8f %.8f\n", e.x, e.y);
    }
  }
  return 0;
}
