#include <bits/stdc++.h>
//#include <atcoder/all>
#define rep(i,n)for(ll i=0;i<(n);i++)
#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
using namespace std;
typedef long long ll;   typedef long double ld; typedef pair<ll,ll>pint;
using vll=vector<ll>;   using vs=vector<string>;
#define p2a(v, p) v[p.first][p.second]

void arrdot(vector<vector<ll>>& v1,vector<vector<ll>>& v2) {
    vector<vector<ll>> buf(3, vll(3,0));
    rep(i,3) rep(j,3) rep(k,3) {
        buf[i][j] += v1[i][k]*v2[k][j];
    }
    v1=buf;
}

void rotXY(pint& p, vector<vll>& rot) {
    ll x=rot[0][0]*p.first+rot[0][1]*p.second+rot[0][2];
    ll y=rot[1][0]*p.first+rot[1][1]*p.second+rot[1][2];
    p = {x,y};
}

int main() {
    ll n; cin >> n;
    vector<pint> point(n);
    rep(i,n) {
        ll x,y; cin >> x>>y;
        point[i]={x,y};
    }
    
    ll m; cin >> m;
    vector<vector<vector<ll>>> rot={{{1,0,0},{0,1,0},{0,0,1}}};
    vector<vector<vll>> rot_op={
        {{0,1,0},{-1,0,0},{0,0,1}},
        {{0,-1,0},{1,0,0},{0,0,1}},
        {{-1,0,2},{0,1,0},{0,0,1}},
        {{1,0,0},{0,-1,2},{0,0,1}},
    };
    rep(i,m) {
        int cmd; cin>>cmd; cmd--;
        vector<vector<ll>> buf=rot_op[cmd];

        if(cmd==2) {
            int p; cin>>p;
            buf[0][2]*=p;
        }
        if(cmd==3) {
            int p; cin>>p;
            buf[1][2]*=p;
        }
        arrdot(buf, rot.back());
        rot.push_back(buf);
    }
    
    // read query
    ll qn; cin >> qn;
    rep(i,qn) {
        ll x,y; cin >> x >> y; y--;
        vector<vector<ll>> rot_i=rot[x];
        pint p = point[y];
        rotXY(p,rot_i);
        cout << p.first << " ";
        cout << p.second << endl;
    }
}

#include <cstdio>
#include <iostream>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;
using db = double; using str = string;
using pi = pair<int,int>;
using vi = vector<int>; using vs = vector<str>;
using vl = vector<ll>; using vd = vector<double>;
using vvi = vector<vector<int>>;
using vvs = vector<vector<string>>;
using vvl = vector<vector<ll>>;
using vvd = vector<vector<double>>;
using pqi = priority_queue<int>;
using rpqi = priority_queue<int, vi, greater<int>>;
using umi = unordered_map<int, int>;
using usi = unordered_set<int>;

#define PB push_back
#define PF push_front
#define PK pop_back()
#define PT pop_front()
#define EB emplace_back
#define LB lower_bound
#define UB upper_bound
#define UM unordered_map
#define US unordered_set
#define PQ priority_queue
#define VT vector
#define se second
#define fi first
#define rt return
#define ln "\n"
#define ctu continue
#define F1(e) for(int i=0;i<(e);++i)
#define F2(i,e) for(int i=0;i<(e);++i)
#define F3(i,b,e) for(int i=(b);i<(e);++i)
#define F4(i,b,e,s) for(int i=(b); (s)>0?i<(e):i>(e); i+=(s))
#define Sum(a) accumulate((a).begin(), (a).end() , 0ll);
#define Min(a) *std::min_element((a).begin(), (a).end())
#define Max(a) *std::max_element((a).begin(), (a).end())
#define Sort(c) sort((c).begin(), (c).end())
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define each(x,a) for(auto& x : a)
#define all(c) (c).begin(), (c).end()
#define rall(a) rbegin(a),rend(a)
#define mst(a,x) memset(a, x, sizeof(a))
#define to_unique(a) a.erase(unique(begin(a), end(a)), end(a))
#define bct(x) (__builtin_popcountll(x))
#define in(x, a) a.find((x)) != a.end()
#define sz(x) ((int)(x).size())
#define sort_unique(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define isok(x, y) (x >= 0 && x < n && y >= 0 && y < m && !vis[x][y])

const ll mod = 1e9 + 7;
const double PI=acos(-1.0);
const int fx[4] = {1, 0, -1, 0}, fy[4] = {0, 1, 0, -1};
const int dx[8]={-1, -1, 0, 1, 1, 1, 0, -1}, dy[8]={0, 1, 1, 1, 0, -1, -1, -1};

template<class A> void read(VT<A>& v);
template<class T> void read(T& x) { cin >> x; }
template<class H, class... T> void read(H& h, T&... t) {
	read(h); read(t...);
}
template<class A> void read(VT<A>& x) {
	each(a, x) read(a);
}

template<class A> void wte(A x) {cout << x;}
template<class H, class... T> void wte(const H& h, const T&... t) {
	wte(h); cout<<' '; wte(t...);
}
template<class A> void wte(VT<A>& x) {
    bool f=1;
	each(a, x){
	    if(f==1) {
	        wte(a); f=0;
	    } else wte(' '),wte(a);
	}
	cout<<'\n';
}
const int N = 1e5 + 10;
int n,m,k;
int a[N];
int main() {
    IOS;
    int x,y;
    read(x,y);
    cout<<x/100.0*y<<ln;
    return 0;
}