# include <bits/stdc++.h>
# define ull unsigned long long
# define ll long long
# define double long double
# define pll pair<ll,ll>
# define pb push_back
# define fi first
# define se second
# define mp make_pair
# define max3(a,b,c) max(a,max(b,c))
# define min3(a,b,c) min(a,min(b,c))
# define all(x) x.begin(),x.end()
# define fill(a,b) memset(a,b,sizeof(a))
# define gcd(m,n)  __gcd(m, n)
# define pr_double(x) cout << fixed << setprecision(9) << x

using namespace std;
const ll INF = 922337203685477110;
const ll N = 200005;
const ll mod  = 998244353;
const ll M = 22;
ll ad[N];
ll bd[N];
ll na[N],nb[N],swp[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll n; cin>>n;
  vector <pll> v;
  for(ll i=0;i<n;i++)
  {
      ll a,b; cin>>a>>b;
      v.pb({a,b});
  }
  ll m; cin>>m;
  na[0]=1; nb[0]=1; swp[0]=1;
  for(ll i=1;i<=m;i++)
  {
      ll c; cin>>c;
      if(c==1)
      {
          swp[i]=-1*swp[i-1];
          ad[i] = bd[i-1];
          bd[i] = ad[i-1]*-1;
          ll temp = nb[i];
          nb[i]=-1*na[i-1];
          na[i]=nb[i-1];
      }
      else if(c==2)
      {
          swp[i]=-1*swp[i-1];
          ad[i] = bd[i-1]*-1;
          ll temp = na[i];
          bd[i] = ad[i-1];
          na[i]=-1*nb[i-1];
          nb[i]=na[i-1];
      }
      else if(c==3)
      {
          ll add; cin>>add;
          swp[i]=swp[i-1]; nb[i]=nb[i-1];
          bd[i]=bd[i-1];
          ad[i] = 2*add-ad[i-1];
          na[i] = -1*na[i-1];
      }
      else{
          ll add; cin>>add;
          swp[i]=swp[i-1]; na[i]=na[i-1];
          ad[i]=ad[i-1];
          bd[i] = 2*add-bd[i-1];
          nb[i] = -1*nb[i-1];
      }
  }
  ll q; cin>>q;
  while(q--)
  {
      ll op,j; cin>>op>>j; j--;
      ll x = v[j].fi; ll y = v[j].se;
      if(swp[op]==-1) swap(x,y);
      if(na[op]==-1) x*=-1;
      if(nb[op]==-1) y*=-1;
      x+=ad[op]; y+=bd[op];
      cout<<x<<" "<<y<<endl;
  }
}

#include <bits/stdc++.h>

#define LL long long

#define ull unsigned long long

#define F(i, j, k) for(int i = j; i <= k; i++)

#define DF(i, j, k) for(int i = j; i >= k; i--)

using namespace std;

template <typename T> inline void read(T &n) {
	T w = 1;
	n = 0;
	char ch = getchar();
	while (!isdigit(ch) && ch != EOF) {
		if (ch == '-') w = -1;
		ch = getchar();
	}
	while (isdigit(ch) && ch != EOF) {
		n = (n << 3) + (n << 1) + (ch & 15);
		ch = getchar();
	}
	n *= w;
}

template <typename T> inline void write(T x) {
	T l = 0;
	ull y = 0;
	if (!x) {
		putchar(48);
		return;
	}
	if (x<0) {
		putchar('-');
		x = -x;
	}
	while (x) {
		y = y * 10 + x % 10;
		x /= 10;
		l++;
	}
	while (l) {
		putchar(y % 10 + 48);
		y /= 10;
		l--;
	}
}

template <typename T> inline void writes(T x) {
	write(x);
	putchar(' ');
}

template <typename T> inline void writeln(T x) {
	write(x);
	puts("");
}

template <typename T> inline void checkmax(T &a,T b) { a = a > b ? a : b; }

template <typename T> inline void checkmin(T &a,T b) { a = a < b ? a : b; }

const int N = 2e5 + 10;

bool chg[N];

struct wzy {
	LL x, c;
	wzy (LL X = 0,LL C = 0) {
		x = X;
		c = C;
	}
};

struct Point {
	LL x, y;
} p[N];

struct Opt {
	wzy x, y;
} opt[N];

int main() {
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	int n;
	read(n);
	F(i, 1, n) {
		read(p[i].x);
		read(p[i].y);
	}
	int m;
	read(m);
	opt[0].x.x = 1;
	opt[0].y.x = 1;
	chg[0] = 0;
	F(i, 1, m) {
		int op;
		LL k;
		read(op);
		if (op == 1 || op == 2) {
			opt[i].x = opt[i - 1].y; 
			opt[i].y = opt[i - 1].x;
			chg[i] = chg[i - 1] ^ 1;
		}
		else {
			opt[i].x = opt[i - 1].x; 
			opt[i].y = opt[i - 1].y; 
			chg[i] = chg[i - 1];
			read(k);
		}
		if (op == 1) { opt[i].y.x = -opt[i].y.x; opt[i].y.c = -opt[i].y.c; }
		if (op == 2) { opt[i].x.x = -opt[i].x.x; opt[i].x.c = -opt[i].x.c;}
		if (op == 3) { opt[i].x.x = -opt[i].x.x; opt[i].x.c = 2 * k - opt[i].x.c; }
		if (op == 4) { opt[i].y.x = -opt[i].y.x; opt[i].y.c = 2 * k - opt[i].y.c; }
	}
	int q;
	read(q);
	F(i, 1, q) {
		int ti, pi;
		read(ti);
		read(pi);
		LL x = p[pi].x;
		LL y = p[pi].y;
		if (chg[ti]) swap(x, y);
		writes(x * opt[ti].x.x + opt[ti].x.c);
		writeln(y * opt[ti].y.x + opt[ti].y.c);
	}
	return 0;
}

