#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-9;
struct point {
  double x, y;
  point() { x = y = 0.0; }
  point(double _x, double _y) {
    x = _x;
    y = _y;
  }
  bool operator<(point p) const {
    if (fabs(x - p.x) > EPS)
      return x < p.x;
    else
      return y < p.y;
  }
};
double getDist(point p1, point p2) {
  return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
}
struct vec {
  double x, y;
  vec() { x = y = 0.0; }
  vec(double _x, double _y) {
    x = _x;
    y = _y;
  }
};
vec toVector(point p1, point p2) { return vec(p2.x - p1.x, p2.y - p1.y); }
double angleWRTx(vec v) {
  double rad = atan2(v.y, v.x);
  if (rad < 0) rad = 2.0 * PI + rad;
  return rad;
}
point pointRotate(point p, double rad) {
  return point(p.x * cos(rad) - p.y * sin(rad),
               p.x * sin(rad) + p.y * cos(rad));
}
point pointRotatePoint(point p1, point p2, double rad) {
  point p = pointRotate(point(p1.x - p2.x, p1.y - p2.y), rad);
  p.x += p2.x;
  p.y += p2.y;
  return p;
}
point ara[10005];
double angle[10005], dist[10005];
point getCentroid(int n) {
  double area = 0.0, tmp;
  point a, b, res = point(0, 0);
  for (int i = 0; i < n; i++) {
    a = ara[i + 1], b = ara[((i + 1) % n) + 1];
    tmp = a.x * b.y - b.x * a.y;
    area += tmp;
    res.x += (a.x + b.x) * tmp;
    res.y += (a.y + b.y) * tmp;
  }
  area *= 0.5;
  res.x /= (area * 6);
  res.y /= (area * 6);
  return res;
}
int main() {
  int i, j, k;
  int n, q, t, pick, put, pin1, pin2;
  scanf("%d %d", &n, &q);
  point center, inCenter;
  double tmp, tx, ty, tot = 0;
  for (i = 1; i <= n; ++i) scanf("%lf %lf", &ara[i].x, &ara[i].y);
  point faltu = ara[1];
  for (i = n; i >= 1; --i)
    ara[i].x = ara[i].x - ara[1].x, ara[i].y = ara[i].y - ara[1].y;
  center = getCentroid(n);
  inCenter = center;
  pin1 = 1;
  pin2 = 2;
  for (i = 1; i <= n; ++i) {
    angle[i] = angleWRTx(toVector(center, ara[i]));
    dist[i] = getDist(ara[i], center);
  }
  while (q--) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d %d", &pick, &put);
      if (pick == pin1) {
        tx = center.x + dist[pin2] * cos(angle[pin2] + tot);
        ty = center.y + dist[pin2] * sin(angle[pin2] + tot);
        tmp = 3.0 * PI / 2.0 - angleWRTx(toVector(point(tx, ty), center));
        center = pointRotatePoint(center, point(tx, ty), tmp);
        pin1 = put;
        tot += tmp;
      } else {
        tx = center.x + dist[pin1] * cos(angle[pin1] + tot);
        ty = center.y + dist[pin1] * sin(angle[pin1] + tot);
        tmp = 3.0 * PI / 2.0 - angleWRTx(toVector(point(tx, ty), center));
        center = pointRotatePoint(center, point(tx, ty), tmp);
        pin2 = put;
        tot += tmp;
      }
      if (tot >= 2.0 * PI) tot -= 2.0 * PI;
    } else {
      scanf("%d", &i);
      tx = center.x + dist[i] * cos(angle[i] + tot);
      ty = center.y + dist[i] * sin(angle[i] + tot);
      printf("%0.10lf %0.10lf\n", tx + faltu.x, ty + faltu.y);
    }
  }
}
