#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double inf = 1e20;
const double pi = acos(-1.0);
int sgn(double x) {
  if (fabs(x) < eps) return 0;
  if (x < 0)
    return -1;
  else
    return 1;
}
inline double sqr(double x) { return x * x; }
struct Point {
  double x, y;
  Point() {}
  Point(double _x, double _y) : x(_x), y(_y) {}
  void input() { scanf("%lf%lf", &x, &y); }
  void output() { printf("%.6f %.6f\n", x, y); }
  bool operator==(Point b) const {
    return sgn(x - b.x) == 0 && sgn(y - b.y) == 0;
  }
  bool operator<(const Point &b) const {
    return sgn(x - b.x) == 0 ? sgn(y - b.y) < 0 : x < b.x;
  }
  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.x + y * b.y; }
  double operator^(const Point &b) const { return x * b.y - y * b.x; }
  Point operator*(const double &k) const { return Point(x * k, y * k); }
  Point operator/(const double &k) const { return Point(x / k, y / k); }
  double len() { return sqrt(x * x + y * y); }
  double len2() { return x * x + y * y; }
  double dis(const Point &p) { return (*this - p).len(); }
  double dis2(const Point &p) { return (*this - p).len2(); }
  Point rotleft() { return Point(-y, x); }
  Point rotright() { return Point(y, -x); }
  Point trunc(double r) {
    double l = len();
    if (!sgn(l)) return *this;
    r /= l;
    return (*this) * r;
  }
  Point rotate(double angle) {
    double c = cos(angle), s = sin(angle);
    return Point(x * c - y * s, x * s + y * c);
  }
  Point rotate(Point p, double angle) {
    return p + ((*this) - p).rotate(angle);
  }
};
double trans(double ang) { return ang / pi * 180; }
double rad(Point a, Point b) { return fabs(atan2(a ^ b, a * b)); }
Point calcO(Point *p, int n) {
  Point O(0, 0);
  double s = 0, sumS = 0;
  for (int i = 2; i <= n - 1; i++) {
    s = ((p[i] - p[1]) ^ (p[i + 1] - p[1])) * 0.5;
    sumS += s;
    O = O + ((p[1] + p[i] + p[i + 1]) * s);
  }
  O = O / (sumS * 3);
  return O;
}
const int N = 10000 + 5;
Point p[N], O;
double ang[N], len[N], angO;
int n, q, pin[2] = {1, 2};
int replace(int f, int t) {
  if (pin[0] == f) {
    pin[0] = t;
    return pin[1];
  } else {
    pin[1] = t;
    return pin[0];
  }
}
void pre() {
  O = calcO(p, n);
  for (int i = 1; i <= n; i++) {
    Point tmp = p[i] - O;
    ang[i] = atan2(tmp.y, tmp.x);
    len[i] = tmp.len();
  }
}
Point query(int x) {
  double ag = ang[x] + angO;
  return O + Point(len[x] * cos(ag), len[x] * sin(ag));
}
void Rotate(int x) {
  O = O.rotate(query(x), pi / 2 - ang[x] - angO);
  angO += pi / 2 - ang[x] - angO;
}
void debug() {
  for (int i = 1; i <= n; i++) query(i).output();
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) p[i].input();
  pre();
  while (q--) {
    int op, f, t, v;
    scanf("%d", &op);
    if (op == 1) {
      scanf("%d%d", &f, &t);
      int tp = replace(f, t);
      Rotate(tp);
    } else {
      scanf("%d", &v);
      query(v).output();
    }
  }
  return 0;
}
