#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
using ll =long long;
using vi = vector<ll>;
using vc = vector<char>;
using vs = vector<string>;
using P = pair<ll , ll>;
using vp = vector<P>;
#define rep(i, n) for (long long int i = 0; i < n; i++)
#define rep2(i, s, n) for (int i = (s); i < n; i++)
#define sort(A) sort(A.begin(),A.end());
#define reverse(A) reverse(A.begin(),A.end());
#define vecint2(A, n, m) vector<vector<long long int>> A(n, vector<long long int>(m));
#define vecchar2(A, n, m) vector<vector<char>> A(n, vector<char>(m));
#define k(s) cout << fixed << setprecision(s);
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
const long double pi=3.14159265358979323846;

int main() {
  int N;
  cin>>N;
  vi X(N),Y(N);
  rep(i,N) cin>>X[i]>>Y[i];
  int M;
  cin>>M;
  vi sita(M+1);
  vi xc(M+1),xd(M+1);
  vi yc(M+1),yd(M+1);
  vi seijou(M+1,0);
  seijou[0]=1;
  rep(i,M){
    int t;
    cin>>t;
    if(t==1){
      xd[i+1]=yd[i];
      yd[i+1]=-xd[i];
      if(seijou[i]==1){
        seijou[i+1]=0;
        xc[i+1]=xc[i]+1;
        yc[i+1]=yc[i];
      }else if(seijou[i]==0){
        seijou[i+1]=1;
        xc[i+1]=xc[i];
        yc[i+1]=yc[i]+1;
      }
    }else if(t==2){
      sita[i+1]=sita[i]+1;
      xc[i+1]=xc[i];
      xd[i+1]=-yd[i];
      yc[i+1]=yc[i];
      yd[i+1]=xd[i];
      if(seijou[i]==1){
        seijou[i+1]=0;
        xc[i+1]=xc[i];
        yc[i+1]=yc[i]+1;
      }else if(seijou[i]==0){
        seijou[i+1]=1;
        xc[i+1]=xc[i]+1;
        yc[i+1]=yc[i];
      }
    }else if(t==3){
      ll p;
      cin>>p;
      if(seijou[i]==1){
        xc[i+1]=xc[i]+1;
        yc[i+1]=yc[i];
      }else{
        xc[i+1]=xc[i];
        yc[i+1]=yc[i]+1;
      } 
      xd[i+1]=2*p-xd[i];
      yd[i+1]=yd[i];
      seijou[i+1]=seijou[i];
    }else{
      ll p;
      cin>>p;
      xd[i+1]=xd[i];
      if(seijou[i]==1){
        yc[i+1]=yc[i]+1;
        xc[i+1]=xc[i];
      }else{
        xc[i+1]=xc[i]+1;
        yc[i+1]=yc[i];
      }
      yd[i+1]=2*p-yd[i];
      seijou[i+1]=seijou[i];
    }
  }
  int Q;
  cin>>Q;
  rep(i,Q){
    int A,B;
    cin>>A>>B;
    ll tx=X[B-1],ty=Y[B-1];
    ll atx,aty;
    if(seijou[A]==1){
      if(xc[A]%2==0) atx=xd[A]+tx;
      else atx=xd[A]-tx;
      if(yc[A]%2==0) aty=yd[A]+ty;
      else aty=yd[A]-ty;
    }else{
      if(yc[A]%2==0) atx=xd[A]+ty;
      else atx=xd[A]-ty;
      if(xc[A]%2==0) aty=yd[A]+tx;
      else aty=yd[A]-tx;
      
    }
    cout<<atx<<" "<<aty<<endl;
  }
}
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
template <typename T>
inline void read(T &x)
{
    T data = 0, f = 1;
    char ch = getchar();
    while (!isdigit(ch))
    {
        if (ch == '-')
            f = -1;
        ch = getchar();
    }
    while (isdigit(ch))
    {
        data = (data << 3) + (data << 1) + ch - '0';
        ch = getchar();
    }
    x = f * data;
}
template <typename T, typename... Args>
inline void read(T &t, Args &...args)
{
    read(t);
    read(args...);
}
const int inf = 0x3f3f3f3f;
const double eps = 1e-8;
const int maxn = 2e5 + 9;
const ll mod = 998244353;
struct point
{
    ll x, y;
    point() {}
    point(int a, int b) : x(a), y(b) {}
};
point p[maxn];
ll mat[maxn][4][4];

signed main()
{
    int n, m, q;
    read(n);
    for (int i = 1; i <= n; ++i)
        read(p[i].x, p[i].y);
    read(m);
    mat[0][1][1] = mat[0][2][2] = mat[0][3][3] = 1;
    for (int i = 1, op, d; i <= m; ++i)
    {
        read(op);
        if (op <= 2)
        {
            if (op == 1)
            {
                for (int j = 1; j <= 3; ++j)
                {
                    mat[i][1][j] = mat[i - 1][2][j];
                    mat[i][2][j] = -mat[i - 1][1][j];
                    mat[i][3][j] = mat[i - 1][3][j];
                }
            }
            else
            {
                for (int j = 1; j <= 3; ++j)
                {
                    mat[i][1][j] = -mat[i - 1][2][j];
                    mat[i][2][j] = mat[i - 1][1][j];
                    mat[i][3][j] = mat[i - 1][3][j];
                }
            }
        }
        else
        {
            read(d);
            if (op == 3)
            {
                for (int j = 1; j <= 3; ++j)
                {
                    mat[i][1][j] = -mat[i - 1][1][j] + 2LL * d * mat[i - 1][3][j];
                    mat[i][2][j] = mat[i - 1][2][j];
                    mat[i][3][j] = mat[i - 1][3][j];
                }
            }
            else
            {
                for (int j = 1; j <= 3; ++j)
                {
                    mat[i][2][j] = -mat[i - 1][2][j] + 2LL * d * mat[i - 1][3][j];
                    mat[i][1][j] = mat[i - 1][1][j];
                    mat[i][3][j] = mat[i - 1][3][j];
                }
            }
        }
    }
    read(q);
    while (q--)
    {
        int a, b;
        read(a, b);
        ll x = p[b].x * mat[a][1][1] + p[b].y * mat[a][1][2] + mat[a][1][3];
        ll y = p[b].x * mat[a][2][1] + p[b].y * mat[a][2][2] + mat[a][2][3];
        printf("%lld %lld\n", x, y);
    }
    return 0;
}