#include <bits/stdc++.h>
using namespace std;
/*
 *  JUST KEEP GOING
 */
#define endl			'\n'
#define ll				long long
#define all(v)			((v).begin()), ((v).end())
#define allr(v)			((v).rbegin()), ((v).rend())
#define sz(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define rep(i, v)		for(int i=0;i<sz(v);++i)
#define For(i,s)        for(auto i:s)
#define Forr(i,s)        for(auto &i:s)
#define lp(i, n)		for(int i=0;i<(int)(n);++i)
#define lpi(i, j, n)	for(int i=(j);i<(int)(n);++i)
#define lpd(i, j, n)	for(int i=(j);i>=(int)(n);--i)
#define int ll
#define vi				vector <int>
#define vl				vector <ll>
#define ii				pair <int,int>
#define vii				vector <ii>
#define vll				vector <pair<ll,ll>>
#define PI acos(-1)
#define bit(mask,i) ((mask>>i)&1)
void run() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
}
const int N = 3e6+5,mod=1e9+7,mod2=998244353,MAXN=1e6+29;
void files(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
struct Point{
    int x,y;
};

signed main() {
    run();
    files();
    int n;
    cin >> n;
    vector<Point> v(n);
    Forr(i, v)cin >> i.x >> i.y;
    int m;
    cin >> m;
    vector<vi > sum(m + 2, vi(2)); // [0] sumX, [1] sumY
    vector<short> isSwapped(m+1);
    vector<vector<short>> sign(m + 2, vector<short>(2));
    sign[0][0] = sign[0][1] = 1;
    int sumY = 0, sumX = 0;
    for (int i = 1; i <= m; ++i) {
        int Type;
        cin >> Type;
        isSwapped[i] = isSwapped[i - 1];
        sum[i][0] = sum[i - 1][0];
        sum[i][1] = sum[i - 1][1];
        sign[i][0] = sign[i - 1][0];
        sign[i][1] = sign[i - 1][1];
        if (Type == 1) {
            isSwapped[i] ^= 1;
            sum[i][!isSwapped[i]] *= -1;
            sign[i][!isSwapped[i]] *= -1;
        } else if (Type == 2) {
            isSwapped[i] ^= 1;
            sum[i][isSwapped[i]] *= -1;
            sign[i][isSwapped[i]] *= -1;
        } else if (Type == 3) {
            int p;
            cin >> p;
            sign[i][isSwapped[i]] *= -1;
            sum[i][isSwapped[i]] = 2 * p - sum[i][isSwapped[i]];
        } else {
            int p;
            cin >> p;
            sign[i][!isSwapped[i]] *= -1;
            sum[i][!isSwapped[i]] = 2 * p - sum[i][!isSwapped[i]];
        }
    }
    int q;
    cin >> q;
    while(q--) {
        int a, b;
        cin >> a >> b;
        b--;
        auto ans = v[b];
        if (isSwapped[a]) {
            swap(ans.x, ans.y);
        }
        ans.x *= sign[a][isSwapped[a]];
        ans.y *= sign[a][!isSwapped[a]];

        ans.x += sum[a][isSwapped[a]];
        ans.y += sum[a][!isSwapped[a]];

        cout << ans.x << ' ' << ans.y << endl;
    }
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
const int N=105;
int n;
vector<pair<int,int>>A,B;
map<tuple<int,int,int>,int>s,t;
int main() 
{
	scanf("%d",&n);
	A.resize(n),B.resize(n);
	for(int i=0;i<n;i++)
		scanf("%d%d",&A[i].first,&A[i].second);
	for(int i=0;i<n;i++)
		scanf("%d%d",&B[i].first,&B[i].second);
	auto add=[](auto &s,auto a1,auto a2,auto a3) 
	{
		int x1=a2.first-a1.first,y1=a2.second-a1.second;
		int x2=a3.first-a1.first,y2=a3.second-a1.second;
		int cr=x1*y2-y1*x2;
		int r1=x1*x1+y1*y1,r2=x2*x2+y2*y2;
		s[{cr,r1,r2}]++;
	};
	for(auto a:A)
		for(auto b:A)
			for(auto c:A)
				add(s,a,b,c);
	for(auto a:B)
		for(auto b:B)
			for(auto c:B)
				add(t,a,b,c);
	puts(s==t?"Yes":"No");
	return 0;
}