#include <bits/stdc++.h>
using namespace std;
int const MAX = 2e5 + 41;
struct Point {
  long double x, y;
  int id;
  Point() {
    x = y = 0;
    id = -1;
  };
  Point(long double x, long double y, int id = -1) : x(x), y(y), id(id){};
  long double getdist(const Point &a) const {
    return sqrt((x - a.x) * (x - a.x) + (y - a.y) * (y - a.y));
  }
};
int n;
Point p[MAX];
int x[MAX];
int y[MAX];
int q;
int qt[MAX];
int qf[MAX];
int qs[MAX];
long double const PI = acos(-1.0);
Point rot(Point p, long double a) {
  Point res;
  res.x = p.x * cos(a) + p.y * sin(a);
  res.y = -p.x * sin(a) + p.y * cos(a);
  return res;
}
Point center;
Point p1, p2;
long double ang1[MAX];
long double ang2[MAX];
long double dist[MAX];
Point v1[MAX];
long double getarea(Point a, Point b, Point c) {
  long double res = 0;
  res += (b.x - a.x) * (a.y + b.y);
  res += (c.x - b.x) * (c.y + b.y);
  res += (a.x - c.x) * (a.y + c.y);
  return fabs(res) / 2;
}
void init() {
  for (int i = 1; i <= n; i++) {
    p[i] = Point(x[i], y[i], i);
  }
  p1 = Point(x[1], y[1], 1);
  p2 = Point(x[2], y[2], 2);
  long double area = 0;
  for (int i = 3; i <= n; i++) {
    area += getarea(p[1], p[i - 1], p[i]);
  }
  for (int i = 3; i <= n; i++) {
    long double x = (p[1].x + p[i - 1].x + p[i].x) / 3;
    long double y = (p[1].y + p[i - 1].y + p[i].y) / 3;
    long double ca = getarea(p[1], p[i - 1], p[i]);
    center.x += ca * x;
    center.y += ca * y;
  }
  center.x /= area;
  center.y /= area;
  while (false) {
  };
  for (int i = 1; i <= n; i++) {
    dist[i] = p[i].getdist(center);
  }
  for (int i = 1; i <= n; i++) {
    ang1[i] = atan2(p[i].y - center.y, p[i].x - center.x);
    v1[i] = Point(p[i].x - center.x, p[i].y - center.y);
  }
}
long double ansx[MAX];
long double ansy[MAX];
Point getposition(int id) {
  center = Point(p1.x, p1.y - dist[p1.id]);
  long double ang = PI / 2 - ang1[p1.id];
  Point v = rot(v1[id], -ang);
  return Point(center.x + v.x, center.y + v.y, id);
}
void solve() {
  init();
  bool f = false;
  for (int i = 1; i <= q; i++) {
    if (qt[i] == 2) {
      if (!f) {
        ansx[i] = x[qf[i]];
        ansy[i] = y[qf[i]];
      } else {
        Point resp = getposition(qf[i]);
        ansx[i] = resp.x;
        ansy[i] = resp.y;
      }
    } else {
      f = true;
      if (qf[i] == p2.id) {
        p2 = getposition(qs[i]);
      } else {
        swap(p1, p2);
        p2 = getposition(qs[i]);
      }
    }
  }
  for (int i = 1; i <= q; i++) {
    if (qt[i] == 2) {
      printf("%.15Lf %.15Lf\n", ansx[i], ansy[i]);
    }
  }
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &x[i], &y[i]);
  }
  for (int i = 1; i <= q; i++) {
    scanf("%d", &qt[i]);
    if (qt[i] == 1) {
      scanf("%d %d", &qf[i], &qs[i]);
    } else {
      scanf("%d", &qf[i]);
    }
  }
  solve();
  return 0;
}
