#include <bits/stdc++.h>
using namespace std;
template<class A, class B> bool maximize(A& x, B y) {if (x < y) return x = y, true; else return false;}
template<class A, class B> bool minimize(A& x, B y) {if (x > y) return x = y, true; else return false;}
#define all(a) a.begin(), a.end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef pair<db, db> pdb;
typedef pair<ld, ld> pld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef pair<int, ll> pill;
const int MAX_N = 2e5 + 5;
int numPoint, numEvent, numQ;
pii a[MAX_N];
pair<string, int> event[MAX_N];
pair<pii, int> q[MAX_N];
pii ans[MAX_N];
bool cntFlipX, cntFlipY;
int valFlipX, valFlipY;
void addFlipX(const int& K) {
cntFlipX ^= 1;
valFlipX = (K << 1) - valFlipX;
}
void addFlipY(const int& K) {
cntFlipY ^= 1;
valFlipY = (K << 1) - valFlipY;
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> numPoint >> numEvent >> numQ;
for (int i = 1; i <= numPoint; i++) {
cin >> a[i].fi >> a[i].se;
}
for (int i = 1; i <= numEvent; i++) {
cin >> event[i].fi;
if (event[i].fi[0] != 'c') {
cin >> event[i].se;
}
}
for (int i = 1; i <= numQ; i++) {
cin >> q[i].fi.se >> q[i].fi.fi; // b a
q[i].se = i;
}
sort(q + 1, q + numQ + 1);
int j = 1, spinTurn = 0;
for (int i = 1; i <= numQ; i++) {
while (j <= q[i].fi.fi) {
if (event[j].fi[0] == 'c') {
if (event[j].fi[1] == 'w') {
spinTurn++;
if (spinTurn == 4) spinTurn = 0;
}
else {
spinTurn--;
if (spinTurn < 0) spinTurn = 3;
}
j++;
continue;
}
int k = event[j].se;
if (event[j].fi[0] == 'x') {
if (spinTurn & 1) {
addFlipY(k * (spinTurn > 1 ? -1 : 1));
}
else {
addFlipX(k * (spinTurn > 1 ? -1 : 1));
}
}
else {
if (spinTurn & 1) {
addFlipX(k * (spinTurn == 1 ? -1 : 1));
}
else {
addFlipY(k * (spinTurn == 2 ? -1 : 1));
}
}
j++;
}
pii curr = a[q[i].fi.se];
curr.fi = valFlipX + (cntFlipX ? -1 : 1) * curr.fi;
curr.se = valFlipY + (cntFlipY ? -1 : 1) * curr.se;
for (int time = 1; time <= spinTurn; time++) {
curr = {curr.se, -curr.fi};
}
ans[q[i].se] = curr;
}
for (int i = 1; i <= numQ; i++) {
cout << ans[i].fi << ' ' << ans[i].se << '\n';
}
return 0;
}
/*
Monday, 08 April 2024
21:59:01
by Asamai
*/