#include <bits/stdc++.h>
using namespace std;
const long double PI = acosl(-1);
pair<long double, long double> arr[200009];
long double dist[200009], ang[200009];
pair<long double, long double> get_centroid(int n) {
  long double area = 0.0, tmp;
  pair<long double, long double> a, b,
      res = pair<long double, long double>(0, 0);
  for (int i = 0; i < n; i++) {
    a = arr[i], b = arr[(i + 1) % n];
    tmp = a.first * b.second - b.first * a.second;
    area += tmp;
    res.first += (a.first + b.first) * tmp;
    res.second += (a.second + b.second) * tmp;
  }
  area *= 0.5;
  res.first /= (area * 6);
  res.second /= (area * 6);
  return res;
}
pair<long double, long double> get(
    int ind, const pair<long double, long double> &centroid,
    const double &angle) {
  pair<long double, long double> ans;
  ans.first = centroid.first + dist[ind] * cosl(angle + ang[ind]);
  ans.second = centroid.second + dist[ind] * sinl(angle + ang[ind]);
  return ans;
}
long double get_dist(const pair<long double, long double> &a,
                     const pair<long double, long double> &b) {
  return sqrtl((a.first - b.first) * (a.first - b.first) +
               (a.second - b.second) * (a.second - b.second));
}
int main() {
  int n, q;
  double a, b;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    scanf("%lf %lf", &a, &b);
    arr[i] = pair<long double, long double>(a, b);
  }
  long double zbx = arr[0].first, zby = arr[0].second;
  for (int i = 0; i < n; i++) {
    arr[i].first -= zbx;
    arr[i].second -= zby;
  }
  int i = 0, j = 1, c, x, y;
  pair<long double, long double> centroid = get_centroid(n), top, nxt;
  long double angle = 0;
  for (int i = 0; i < n; i++) {
    dist[i] = get_dist(arr[i], centroid);
    ang[i] =
        atan2l(arr[i].second - centroid.second, arr[i].first - centroid.first);
    if (ang[i] < 0) ang[i] += 2 * PI;
  }
  while (q--) {
    scanf("%d", &c);
    if (c == 1) {
      scanf("%d %d", &x, &y);
      x--, y--;
      if (x == i) {
        i = y;
        top = get(j, centroid, angle);
        nxt = pair<long double, long double>(top.first, top.second - dist[j]);
      } else {
        j = y;
        top = get(i, centroid, angle);
        nxt = pair<long double, long double>(top.first, top.second - dist[i]);
      }
      angle += -PI / 2 -
               atan2l(centroid.second - top.second, centroid.first - top.first);
      while (angle < 0) angle += 2 * PI;
      while (angle > 2 * PI) angle -= 2 * PI;
      centroid = nxt;
    } else {
      scanf("%d", &x);
      top = get(x - 1, centroid, angle);
      printf("%.10f %.10f\n", (double)(top.first + zbx),
             (double)(top.second + zby));
    }
  }
  return 0;
}
