#include<bits/stdc++.h>				//Written by ThiDaiLoc
using namespace std;				//Team Three Wolves
typedef long long ll;				
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> trp;
typedef vector<ll> vi;
typedef vector<pll> vp;

#define fu(i,a,b)   for(ll i=a;i<=b;i++)
#define f1(i,n)     for(ll i=1;i<=n;i++)
#define fs(i,s)     for(ll i=0;i+1<=s.length();i++)
#define fd(i,b,a)   for(ll i=b;i>=a;i--)
#define fuv(i,a)    for(ll i=0;i<a.size();i++)
#define fdv(i,a)    for(ll i=(ll)a.size()-1;i>=0;i--)
#define ms(a,x)     memset(a, x, sizeof a)
#define prec(n)     fixed<<setprecision(n)
#define uni(a)      (a).erase(unique(all(a)), (a).end())
#define pb(i)       push_back(i)
#define pob         pop_back()
#define sc(a)       cin>>a
#define sc2(a,b)    cin>>a>>b
#define sc3(a,b,c)  cin>>a>>b>>c
#define pr(a)       cout<<a<<endl
#define pr2(a,b)    cout<<a<<" "<<b<<endl
#define rpr(a)      return cout<<a<<endl,0
#define prY         cout<<"YES"<<endl
#define prN         cout<<"NO"<<endl
#define bit(n,i)    (((n)>>(i))&1)
#define lowb(a,n,x) lower_bound(a,a+n,x) -a
#define lowb2(a,x)  lower_bound(all(a),x) -a.begin()
#define all(x)      (x).begin(), (x).end()
#define sz(a)       (ll)a.size()
#define le(s)       (ll)s.length()		
#define re          return 	
#define	mp(a,b)     make_pair(a,b)
#define	mp3(a,b,c)  make_pair(a,make_pair(b,c))
#define se          second
#define fi          first 
#define sse         second.second
#define sfi         second.first
#define soA         sort(A+1,A+1+n)
#define so(A,n)     sort(A+1,A+1+n)
#define sov(v)      sort(all(v))
#define sovr(v)     sort(all(v),greater<ll>())
#define debug(x)    cerr << #x << " = " << x << endl
#define INPUT       freopen("locin.txt", "r", stdin)
#define OUTPUT      freopen("locout.txt", "w", stdout)
inline ll isqrt(ll k) {ll r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline ll mnz(ll& a,ll b){return a=(a>b?b:a);}
inline ll mxz(ll& a,ll b){return a=(a<b?b:a);}
inline string toString(ll n) {stringstream ss; ss << n;return ss.str();}
double const eps = 1e-6;
ll const Base=1e9+7,oo=1e17,MAXN=1e6;

pll A[MAXN+5];
pll B[MAXN+5];
pll add[MAXN+5];
pll xy[MAXN+5];
ll Solves(){
	
	ll n,m,k,cnt=0,ans=0,x,y,q,c,sum=0,v,t;
	// PROCESS IN HERE
	cin>>n;
	f1(i,n)sc2(A[i].fi,A[i].se);
	
	sc(m);
	xy[0]=mp(1,2);
	f1(i,m){
		sc(x);
		if(x>=3){
			sc(y);
		}
		if(x==1){
			xy[i]=mp(xy[i-1].se,-xy[i-1].fi);
			add[i]=mp(add[i-1].se,-add[i-1].fi);
		}
		if(x==2){
			xy[i]=mp(-xy[i-1].se,xy[i-1].fi);
			add[i]=mp(-add[i-1].se,add[i-1].fi);
		}
		if(x==3){
			xy[i]=xy[i-1];
			xy[i].fi=-xy[i].fi;
			add[i]=add[i-1];			
			add[i].fi=-add[i].fi;
			add[i].fi+=y*2;
		}
		if(x==4){
			xy[i]=xy[i-1];
			xy[i].se=-xy[i].se;
			add[i]=add[i-1];
			add[i].se=-add[i].se;
			add[i].se+=y*2;
		}
	}
	sc(q);
	f1(i,q){
		sc2(x,y);
		if(abs(xy[x].fi)==1){
			v=A[y].fi;
			if(xy[x].fi<0)v=-v;
			t=A[y].se;
			if(xy[x].se<0)t=-t;
		}
		else{
			v=A[y].se;
			if(xy[x].fi<0)v=-v;
			t=A[y].fi;
			if(xy[x].se<0)t=-t;
		}
		
		v+=add[x].fi;
		t+=add[x].se;
		cout<<v<<" "<<t<<endl;
	}
	
	
	
	
	re 0;
	// Hack it if you can :)
}

int main(){
	//INPUT;
	if(fopen("locin.txt", "r"))INPUT;
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll test=1;
//	sc(test);
	fu(T,1,test){
//		cout<<"Case #"<<T<<": ";
		Solves();
	} 		
}
#include <bits/stdc++.h>
using namespace std;

const int MOD = 1000000007;
const int INF = 1e9;
const long long INFLL = 1e18;
using ll = long long;

ll mat[200000+10][2][2];
ll p[200000+10][2];
ll mix, miy;

vector<vector<ll>> cal(ll n, ll p){
  vector<vector<ll>> res(2, vector<ll>(2));
  if(n == 1){
    res[0][0] = 0;
    res[0][1] = 1;
    res[1][0] = -1;
    res[1][1] = 0;
  }else if(n == 2){
    res[0][0] = 0;
    res[0][1] = -1;
    res[1][0] = 1;
    res[1][1] = 0;
  }else if(n == 3){

  }

  return res;
}

int main(){
  ll n;
  cin >> n;
  vector<ll> x(n), y(n);
  for(ll i = 0; i < n; i++) cin >> x[i] >> y[i];

  ll m;
  cin >> m;
  mix = -1;
  miy = -1;
  mat[0][0][0] = 1;
  mat[0][0][1] = 0;
  mat[0][1][0] = 0;
  mat[0][1][1] = 1;
  p[0][0] = 0;
  p[0][1] = 0;
  for(ll i = 1; i <= m; i++){
    ll op;
    cin >> op;
    if(op == 1){
      mat[i][0][0] = mat[i-1][1][0];
      mat[i][0][1] = mat[i-1][1][1];
      mat[i][1][0] = -mat[i-1][0][0];
      mat[i][1][1] = -mat[i-1][0][1];
      // p[i][0] = mat[i][0][0]*p[i-1][0] + mat[i][0][1]*p[i-1][1];
      // p[i][0] = mat[i][1][0]*p[i-1][0] + mat[i][1][1]*p[i-1][1];
      p[i][0] = p[i-1][1];
      p[i][1] = -p[i-1][0];
    }else if(op == 2){
      mat[i][0][0] = -mat[i-1][1][0];
      mat[i][0][1] = -mat[i-1][1][1];
      mat[i][1][0] = mat[i-1][0][0];
      mat[i][1][1] = mat[i-1][0][1];
      // p[i][0] = mat[i][0][0]*p[i-1][0] + mat[i][0][1]*p[i-1][1];
      // p[i][0] = mat[i][1][0]*p[i-1][0] + mat[i][1][1]*p[i-1][1];
      p[i][0] = -p[i-1][1];
      p[i][1] = p[i-1][0];
    }else if(op == 3){
      ll pp;
      cin >> pp;
      mix *= -1;
      mat[i][0][0] = -mat[i-1][0][0];
      mat[i][0][1] = -mat[i-1][0][1];
      mat[i][1][0] = mat[i-1][1][0];
      mat[i][1][1] = mat[i-1][1][1];
      p[i][0] = -1 * p[i-1][0] + 2*pp;
      p[i][1] = p[i-1][1];
    }else{
      ll pp;
      cin >> pp;
      miy *= -1;
      mat[i][0][0] = mat[i-1][0][0];
      mat[i][0][1] = mat[i-1][0][1];
      mat[i][1][0] = -mat[i-1][1][0];
      mat[i][1][1] = -mat[i-1][1][1];
      p[i][0] = p[i-1][0];
      p[i][1] = -1 * p[i-1][1] + 2*pp;
    }
  }

  ll q;
  cin >> q;
  for(ll i = 0; i < q; i++){
    ll a, b;
    cin >> a >> b;
    b --;
    ll nx = mat[a][0][0]*x[b] + mat[a][0][1]*y[b] + p[a][0];
    ll ny = mat[a][1][0]*x[b] + mat[a][1][1]*y[b] + p[a][1];
    cout << nx << " " << ny << endl;
  }

  return 0;
}