/**
 *    author:  otera    
**/
#include<bits/stdc++.h>
using namespace std;

#define int long long
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60;
#define rep(i, n) for(int i = 0; i < n; ++ i)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void solve() {
    int n, m; cin >> n;
    vector<int> x(n), y(n);
    rep(i, n) {
        cin >> x[i] >> y[i];
    }
    cin >> m;
    vector<int> r(m + 1, 0);
    vector<int> sx(m + 1, 1), sy(m + 1, 1);
    vector<int> nx(m + 1, 0), ny(m + 1, 0);
    rep(i, m) {
        int op; cin >> op;
        r[i + 1] = r[i];
        sx[i + 1] = sx[i], sy[i + 1] = sy[i];
        nx[i + 1] = nx[i], ny[i + 1] = ny[i];
        if(op == 1) {
            r[i + 1] ^= 1;
            swap(sx[i + 1], sy[i + 1]);
            swap(nx[i + 1], ny[i + 1]);
            sy[i + 1] *= (-1); //?
            ny[i + 1] *= (-1); //?
        } else if(op == 2) {
            r[i + 1] ^= 1;
            swap(sx[i + 1], sy[i + 1]);
            swap(nx[i + 1], ny[i + 1]);
            sx[i + 1] *= (-1); //?
            nx[i + 1] *= (-1); //?
        } else if(op == 3) {
            sx[i + 1] *= (-1);
            nx[i + 1] *= (-1);
            int p; cin >> p;
            nx[i + 1] += 2 * p;
        } else {
            sy[i + 1] *= (-1);
            ny[i + 1] *= (-1);
            int p; cin >> p;
            ny[i + 1] += 2 * p;
        }
    }
    int q; cin >> q;
    rep(_, q) {
        int a, b; cin >> a >> b;
        -- b;
        int X = x[b], Y = y[b];
        if(r[a]) swap(X, Y);
       // cerr << a << " " << sy[a] << " " << ny[a] << "\n";
        cout << X * sx[a] + nx[a] << " " << Y * sy[a] + ny[a] << "\n";
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(20);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}
#include<bits/stdc++.h>
#define int long long		
using namespace std;
vector <vector<int> > multi(vector<vector<int> >&a,vector<vector<int> >&b,vector<vector<int> >&ans)
{
	for(int i=0;i<3;i++)
	{
		for(int j=0;j<3;j++)
		{
			for(int k=0;k<3;k++)
			{
				ans[i][j]+=a[i][k]*b[k][j];
			}
		}
	}
	return ans;
}
signed main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    while(t--)
    {
    	int n;
    	cin>>n;
    	pair<int,int> co[n];
    	for(int i=0;i<n;i++)
    	{
    		cin>>co[i].first>>co[i].second;
    	}
    	int m;
    	cin>>m;
    	vector<vector<vector<int> > > op(m+100,vector<vector<int> >(3,vector<int>(3,0)));
    	op[0][0][0]=1;
    	op[0][1][1]=1;
    	op[0][2][2]=1;
    	for(int i=1;i<=m;i++)
    	{
    		int k;
    		cin>>k;
    		if(k==1)
    		{
    			vector<vector<int> > temp(3,vector<int>(3,0));
    			temp[0][1]=1;
    			temp[1][0]=-1;
    			temp[2][2]=1;
    			multi(temp,op[i-1],op[i]);
    		}
    		if(k==2)
    		{
    			vector<vector<int> > temp(3,vector<int>(3,0));
    			temp[0][1]=-1;
    			temp[1][0]=1;
    			temp[2][2]=1;
    			multi(temp,op[i-1],op[i]);
    		}
    		if(k==3)
    		{
    			int p;
    			cin>>p;
    			vector<vector<int> > temp(3,vector<int>(3,0));
    			temp[0][0]=-1;
    			temp[1][1]=1;
    			temp[2][2]=1;
    			temp[0][2]=2*p;
    			multi(temp,op[i-1],op[i]);
    		}
    		if(k==4)
    		{
    			int p;
    			cin>>p;
    			vector<vector<int> > temp(3,vector<int>(3,0));
    			temp[0][0]=1;
    			temp[1][1]=-1;
    			temp[2][2]=1;
    			temp[1][2]=2*p;
    			multi(temp,op[i-1],op[i]);
    		}
       	}
    	int q;
    	cin>>q;
    	while(q--)
    	{
    		int a,b;
    		cin>>a>>b;
    		b--;
    		int x,y;
    		x=op[a][0][0]*co[b].first+op[a][0][1]*co[b].second+op[a][0][2];
    		y=op[a][1][0]*co[b].first+op[a][1][1]*co[b].second+op[a][1][2];
    		cout<<x<<' '<<y<<endl;
    	}
    }
	return 0;
}