#include <bits/stdc++.h>
using namespace std;

int main() {
	long long n,m,i,t,p,q,query,a,b;
	cin >> n;
	vector<long long> x(n),y(n);
	for(i=0; i<n; i++){
		cin >> x[i] >> y[i];
	}
	
	cin >> m;
	vector<long long> px(m+1),py(m+1),dx(m+1),dy(m+1);
	px[0]=1; py[0]=2; dx[0]=0; dy[0]=0;
	for(i=0; i<m; i++){
		cin >> t;
		if(t==1){
			px[i+1]=py[i];
			py[i+1]=-px[i];
			dx[i+1]=dy[i];
			dy[i+1]=-dx[i];
		}else if(t==2){
			px[i+1]=-py[i];
			py[i+1]=px[i];
			dx[i+1]=-dy[i];
			dy[i+1]=dx[i];
		}else if(t==3){
			cin >> p;
			px[i+1]=-px[i];
			py[i+1]=py[i];
			dx[i+1]=2*p-dx[i];
			dy[i+1]=dy[i];
		}else if(t==4){
			cin >> p;
			px[i+1]=px[i];
			py[i+1]=-py[i];
			dx[i+1]=dx[i];
			dy[i+1]=2*p-dy[i];
		}
	}
	long long ansx,ansy;
	cin >> query;
	for(q=0; q<query; q++){
		cin >> a >> b;
		b--;
		if(px[a]==1){
			ansx=x[b]+dx[a];
		}else if(px[a]==2){
			ansx=y[b]+dx[a];
		}else if(px[a]==-1){
			ansx=-x[b]+dx[a];
		}else{
			ansx=-y[b]+dx[a];
		}
		
		if(py[a]==1){
			ansy=x[b]+dy[a];
		}else if(py[a]==2){
			ansy=y[b]+dy[a];
		}else if(py[a]==-1){
			ansy=-x[b]+dy[a];
		}else{
			ansy=-y[b]+dy[a];
		}
		cout << ansx << ' ' << ansy << endl;
	}
	return 0;
}
#include <bits/stdc++.h>
using namespace std;

using ll = long long;

#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for(int (i) = (n); (i) >= 0; --(i))
#define FOR(i, n, m) for(int (i) = (n); (i) < (m); ++(i))

template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return 1; } return 0; }
constexpr int INF = 1e9;
constexpr ll INFL = 1LL << 61;
constexpr ll mod = 1e9+7;


int main(){
  int N;
  cin >> N;
  vector<ll> X(N), Y(N);
  REP(i, N){
    cin >> X[i] >> Y[i];
  }
  int M;
  cin >> M;
  vector<bool> need_swap(M+1, false);
  vector<vector<ll>> add(M+1, vector<ll>(2, 0));
  vector<int> x_sign(M+1, 1), y_sign(M+1, 1);
  REP(i, M){
    int op;
    cin >> op;
    x_sign[i+1] = x_sign[i];
    y_sign[i+1] = y_sign[i];
    need_swap[i+1] = need_swap[i];
    add[i+1][0] = add[i][0];
    add[i+1][1] = add[i][1];
    if(op==1){
      // (y, -x)
      add[i+1][0] = add[i][1];
      add[i+1][1] = -add[i][0];
      need_swap[i+1] = !need_swap[i];
      swap(y_sign[i+1], x_sign[i+1]);
      y_sign[i+1] *= -1;
    }
    else if(op==2){
      // (-y, x)
      add[i+1][0] = -add[i][1];
      add[i+1][1] = add[i][0];
      need_swap[i+1] = !need_swap[i];
      swap(y_sign[i+1], x_sign[i+1]);
      x_sign[i+1] *= -1;
    }
    else if(op==3){
      int p;
      cin >> p;
      // (p+p-x, y)
      add[i+1][0] = 2*p- add[i][0];
      add[i+1][1] = add[i][1];
      x_sign[i+1] *= -1;
    }
    else{
      int p;
      cin >> p;
      // (x, p+p-y)
      add[i+1][0] = add[i][0];
      add[i+1][1] = 2*p-add[i][1];
      y_sign[i+1] *= -1;
    }
  }

  int Q;
  cin >> Q;
  REP(i, Q){
    int A, B;
    cin >> A >> B;
    B--;
    ll x = X[B], y = Y[B];
    if(need_swap[A]){
      swap(x, y);
    }
    cout << add[A][0] + x_sign[A] * x << " " << add[A][1] + y_sign[A] * y << endl;
  }
  return  0;
}
