#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = (1 << 20) + 5;
constexpr int MOD = 1e9 + 7;
constexpr long long MOD2 = 1e9 + 9;
constexpr double eps = 1e-6;
constexpr int INF = (1 << 30);
int dir[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
const int N = 1e6 + 9;
const long double pi = atan(1.0) * 4;
const long double Eps = 1e-6;
inline long double Dot(complex<long double> a, complex<long double> b) {
  return (conj(a) * b).real();
}
inline long double Cross(complex<long double> a, complex<long double> b) {
  return (conj(a) * b).imag();
}
inline long double Dist(complex<long double> a, complex<long double> b) {
  return abs(a - b);
}
vector<complex<long double> > p;
complex<long double> getCen(vector<complex<long double> > const &s) {
  long double area = 0, resx = 0, resy = 0;
  int n = s.size();
  for (int i = 0; i < n; i++) {
    area += Cross(s[i], s[(i + 1) % n]);
    resx += Cross(s[i], s[(i + 1) % n]) * (s[i].real() + s[(i + 1) % n].real());
    resy += Cross(s[i], s[(i + 1) % n]) * (s[i].imag() + s[(i + 1) % n].imag());
  }
  return complex<long double>(resx / area / 3.0, resy / area / 3.0);
}
long double ang[N / 10], len[N / 10];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  int n, q;
  while (cin >> n >> q) {
    memset(ang, 0, sizeof(ang));
    memset(len, 0, sizeof(len));
    auto get = [](complex<long double> p, long double len, long double angle) {
      long double dx = p.real() + len * cosl(angle);
      long double dy = p.imag() + len * sinl(angle);
      return complex<long double>(dx, dy);
    };
    long double res = 0;
    p.clear();
    long double x0, y0;
    cin >> x0 >> y0;
    complex<long double> p0(x0, y0);
    p.push_back(complex<long double>(0, 0));
    for (int i = 1; i < n; i++) {
      long double xi, yi;
      cin >> xi >> yi;
      xi -= x0, yi -= y0;
      p.push_back(complex<long double>(xi, yi));
    }
    complex<long double> center = getCen(p);
    for (int i = 0; i < n; i++) {
      len[i] = Dist(p[i], center);
      ang[i] = atan2l(p[i].imag() - center.imag(), p[i].real() - center.real());
      while (ang[i] < 0) ang[i] += 2 * pi;
    }
    int pin1 = 0, pin2 = 1;
    while (q--) {
      int type;
      cin >> type;
      if (type == 1) {
        int f, t;
        cin >> f >> t;
        f--, t--;
        if (pin1 != f) swap(pin1, pin2);
        complex<long double> top =
            center + len[pin2] * exp(complex<long double>(0, res + ang[pin2]));
        complex<long double> next =
            complex<long double>(top.real(), top.imag() - len[pin2]);
        res += -pi / 2 -
               atan2l(center.imag() - top.imag(), center.real() - top.real());
        while (res < 0) res += 2 * pi;
        while (res > 2 * pi) res -= 2 * pi;
        pin1 = t;
        center = next;
      } else {
        int v;
        cin >> v;
        v--;
        complex<long double> tmp =
            center + len[v] * exp(complex<long double>(0, res + ang[v]));
        cout << tmp.real() + p0.real() << ' ' << tmp.imag() + p0.imag() << '\n';
      }
    }
  }
  return 0;
}
