#include <bits/stdc++.h>
using namespace std;
const int maxn = 10000;
const long double eps = 1e-12;
struct Point {
  long double x, y;
  Point() {}
  Point(long double _x, long double _y) : x(_x), y(_y) {}
  Point operator+(const Point &t) const { return Point(x + t.x, y + t.y); }
  Point operator-(const Point &t) const { return Point(x - t.x, y - t.y); }
  Point operator*(const long double &t) const { return Point(x * t, y * t); }
  Point operator/(const long double &t) const { return Point(x / t, y / t); }
  long double operator*(const Point &t) const { return x * t.y - y * t.x; }
  long double len() const { return sqrtl(x * x + y * y); }
} a[maxn + 5], d[maxn + 5], g, key;
struct Complex {
  long double x, y;
  Complex(long double x = 0.0, long double y = 0.0) : x(x), y(y) {}
  Complex operator+(const Complex &t) const {
    return Complex(x + t.x, y + t.y);
  }
  Complex operator-(const Complex &t) const {
    return Complex(x - t.x, y - t.y);
  }
  Complex operator*(const Complex &t) const {
    return Complex(x * t.x - y * t.y, x * t.y + y * t.x);
  }
  Complex operator/(const Complex &t) const {
    return Complex((x * t.x + y * t.y) / (t.x * t.x + t.y * t.y),
                   (y * t.x - x * t.y) / (t.x * t.x + t.y * t.y));
  }
};
int n, m;
int pin[2] = {1, 2};
void calcentre() {
  long double area = 0.0;
  for (int i = 2; i < n; ++i) area += (a[i + 1] - a[i]) * (a[1] - a[i]);
  g = Point(0, 0);
  for (int i = 2; i < n; ++i) {
    long double s = (a[i + 1] - a[i]) * (a[1] - a[i]);
    g = g + (a[1] + a[i] + a[i + 1]) / 3.0 * (s / area);
  }
}
Point cal(Point now, int v) {
  Complex pre = Complex(d[1].x, d[1].y);
  Complex ans = Complex(d[v].x, d[v].y);
  Complex nnow = Complex(now.x, now.y);
  Complex res = ans / pre * nnow;
  return g - Point(res.x, res.y);
}
void rot(Point top) {
  Point topg = g - top;
  long double len = topg.len();
  Point newg = Point(0, -1) * len;
  Complex tmp = Complex((key - top).x, (key - top).y);
  tmp = tmp * (Complex(newg.x, newg.y) / Complex(topg.x, topg.y));
  g = newg + top;
  key = top + Point(tmp.x, tmp.y);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) cin >> a[i].x >> a[i].y;
  key = a[1];
  calcentre();
  for (int i = 1; i <= n; ++i) d[i] = g - a[i];
  while (m--) {
    int op;
    scanf("%d", &op);
    if (op == 2) {
      int v;
      scanf("%d", &v);
      Point ans = cal(g - key, v);
      printf("%.10Lf %.10Lf\n", ans.x + eps, ans.y + eps);
    } else {
      int f, t;
      scanf("%d%d", &f, &t);
      if (pin[0] != f) swap(pin[0], pin[1]);
      pin[0] = t;
      Point top = cal(g - key, pin[1]);
      rot(top);
    }
  }
  return 0;
}
