```cpp
include <iostream>
#include <string.h>
using namespace std;
const int maxn = 10010;
struct Command{
char c[5];
int a, x[20];
int r1, c1, r2, c2;
}cmd[maxn];
int r, c, n;
int simulate(int &r, int &c){
for(int i=0; i<n; ++i){
if(cmd[i].c[0] == 'E'){
if(cmd[i].r1==r && cmd[i].c1==c) {r=cmd[i].r2; c=cmd[i].c2;}
else if(cmd[i].r2==r && cmd[i].c2==c) {r=cmd[i].r1; c=cmd[i].c1;}
}else{
int dr = 0, dc = 0;
for(int j=0; j<cmd[i].a; ++j){
int x = cmd[i].x[j];
if(cmd[i].c[0] == 'I'){
if(cmd[i].c[1]=='R' && x<=r) dr++;
if(cmd[i].c[1]=='C' && x<=c) dc++;
}else{
if(cmd[i].c[1]=='R' && x==r || cmd[i].c[1]=='C' && x==c) return 0;
if(cmd[i].c[1]=='R' && x<r) dr--;
if(cmd[i].c[1]=='C' && x<c) dc--;
}
}
r += dr; c += dc;
}
}
return 1;
}
int main(){
int r0, c0, q, kase = 0;
while(scanf("%d%d%d", &r,&c,&n)==3&&r){
for(int i=0; i<n; ++i){
scanf("%s", &cmd[i].c);
if(cmd[i].c[0]=='E'){
scanf("%d%d%d%d", &cmd[i].r1,&cmd[i].c1,&cmd[i].r2,&cmd[i].c2);
}else{
scanf("%d", &cmd[i].a);
for(int j=0; j<cmd[i].a; ++j) scanf("%d", &cmd[i].x[j]);
}
}
if(kase>0) puts("");
printf("Spreadsheet #%d\n", ++kase);
scanf("%d", &q);
while(q--){
scanf("%d%d", &r0,&c0);
printf("Cell data in (%d,%d) ", r0,c0);
if(!simulate(r0,c0)) printf("GONE\n");
else printf("moved to (%d,%d)\n", r0,c0);
}
}
return 0;
}