#include <bits/stdc++.h>
using namespace std;
int main() {
long int n=0,x[100000]={0},y[100000]={0},q=0,I=0,X=0,Y=0,L=0,R=0,temp2=0,dff=0;
char temp;
scanf("%ld", &n);
for(int i=0;i<n;i++)
{
scanf("%ld%ld", &x[i], &y[i]);
}
scanf("%ld",&q);
for(int i=0;i<q;i++)
{
scanf(" %c",&temp);
temp2=0;
dff=0;
I=0,X=0,Y=0,L=0,R=0;
switch(temp)
{
case 'U':
scanf("%ld%ld%ld", &I,&X,&Y);
x[I]=X;
y[I]=Y;
break;
case 'Q':
scanf("%ld%ld", &L,&R);
int j=L;
while(j<=R-1)
{
int k=j+1;
while(k<=R)
{
dff=abs(x[j]-x[k]) + abs(y[j]-y[k]);
if(dff>temp2)
{
temp2=dff;
}
k++;
}
j++;
}
printf("%ld\n", temp2);
break;
}
}
return 0;
}