#include<bits/stdc++.h>
#define _USE_MATH_DEFINES
using namespace std;
    
#define ll long long int
#define ld double
#define pb push_back
#define eb emplace_back
#define rep(i , j , n) for(ll i = j ; i < n ; i++)
#define pre(i , j , n) for(ll i = j ; i >= n ; i--) 
#define all(x) x.begin(), x.end()
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vll;
typedef vector<double>	vd;
typedef vector<bool>	vb;
typedef pair<ll,ll> 	pll;
#define br "\n"
#define ff first
#define ss second
#define debug(a...) cout<<#a<<": ";for(auto it:a)cout<<it<<" ";cout<<endl;
#define MAXIM 100005
ll MAX = 2e4 + 1;
ll mod = 1e9 + 7;

void solve(){
    ll n;
    cin >> n;
    vector<vll> v(n,vll(2));
    rep(i,0,n) cin >> v[i][0] >> v[i][1];
    ll m;
    cin >> m;
    vb sw(m + 1);
    vector<vll> neg(m + 1,vll(2,1)),c(m + 1,vll(2));
    rep(i,1,m + 1){
        neg[i] = neg[i - 1];
        c[i] = c[i - 1];
        sw[i] = sw[i - 1];
        ll op;
        cin >> op;
        if(op == 1 || op == 2){
            sw[i] = !sw[i];
            swap(c[i][0],c[i][1]);
            swap(neg[i][0],neg[i][1]);
            if(op == 1){
                c[i][1] *= -1;
                neg[i][1] *= -1;
            }
            else{
                c[i][0] *= -1;
                neg[i][0] *= -1;
            }
        }
        else{
            ll p;
            cin >> p;
            if(op == 3){
                c[i][0] *= -1;
                neg[i][0] *= -1;
                c[i][0] += 2*p;
            }
            else{
                c[i][1] *= -1;
                neg[i][1] *= -1;
                c[i][1] += 2*p;
            }
        }
    }
    ll q;
    cin >> q;
    rep(i,0,q){
        ll a,ind;
        cin >> a >> ind;
        ind--;
        ll x = v[ind][0],y = v[ind][1];
        if(sw[a]) swap(x,y);
        x *= neg[a][0];
        y *= neg[a][1];
        x += c[a][0];
        y += c[a][1];
        cout << x << " " << y << br;
    }

}

 
int main(){ 
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif 
    
	ll t = 1;
    // cin >> t;
    // cout << p.size();
	rep(i,0,t){
        // cout << "Case #" << i + 1 << ": ";
        solve();
        // test();
	}
}
#include <cstdio>
#include <algorithm>
typedef long long ll;
const int N = 200005;
int n, m, q;
ll x[N], y[N];
struct Option
{
	int ty;
	ll p;
}op[N];
struct Query
{
	int a, b, id;
}p[N];
int np;
inline bool cmp(Query a, Query b)
{
	return a.a < b.a;
}
ll ansx[N], ansy[N];
ll flx, flxa, fly, flya, rot;
void get(ll x, ll y, ll& rx, ll& ry)
{
	for(int i = 1;i <= rot;++i)
	{
		std::swap(x, y);
		x *= -1;
	}
	rx = x*flxa+flx;
	ry = y*flya+fly;
	return;
}
int main(void)
{
	scanf("%d", &n);
	for(int i = 1;i <= n;++i)
		scanf("%lld%lld", x+i, y+i);
	scanf("%d", &m);
	for(int i = 1;i <= m;++i)
	{
		scanf("%d", &op[i].ty);
		if(op[i].ty >= 3)
			scanf("%lld", &op[i].p);
	}
	scanf("%d", &q);
	for(int i = 1;i <= q;++i)
		scanf("%d%d", &p[i].a, &p[i].b), p[i].id = i;
	std::sort(p+1, p+1+q, cmp);
	np = 1;
	flxa = flya = 1;
	for(int i = 0;i <= m;++i)
	{
		if(op[i].ty == 1)
		{
			rot = (rot+3)%4;
			std::swap(flx, fly), std::swap(flxa, flya);
			fly *= -1;
		}
		else if(op[i].ty == 2)
		{
			rot = (rot+1)%4;
			std::swap(flx, fly), std::swap(flxa, flya);
			flx *= -1;
		}
		else if(op[i].ty == 3)
			flxa *= -1, flx = -flx+2*op[i].p;
		else if(op[i].ty == 4)
			flya *= -1, fly = -fly+2*op[i].p;
		while(np <= q && p[np].a == i)
			get(x[p[np].b], y[p[np].b], ansx[p[np].id], ansy[p[np].id]), ++np;
	}
	for(int i = 1;i <= q;++i)
		printf("%lld %lld\n", ansx[i], ansy[i]);
	return 0;
}