#include <bits/stdc++.h>
typedef long long int LL;
using namespace std;
const int N = 1e5+7;
const int MOD = 1e9+7;
#define DEBUG true
#define DATA 1
#define STD 2
#define VALID 3
int random(int x){
return (LL)rand()%rand()%x;
}
void stdinout(int k, int status){
string file_in = "testcase/" + to_string(k) + ".in";
string file_out = "testcase/" + to_string(k) + ".out";
if(1==status){
freopen(file_in.c_str(), "w" ,stdout);
}
else if(2==status){
freopen(file_in.c_str(), "r", stdin);
freopen(file_out.c_str(), "w", stdout);
}
else if(3==status){
freopen(file_in.c_str(), "r", stdin);
}
}
int a[N];
int L[N],R[N];
LL sum[N];
#define lowbit(op) ((op)&(-op))
void update(int i,int v){
for(;i<N;i+=lowbit(i)) sum[i]+=v;
}
LL getSum(int i){
LL ans = 0;
for(;i;i-=lowbit(i)) ans+=sum[i];
return ans;
}
void run(){
int n,m,k;
int kcase = 0;
while(~scanf("%d%d%d",&n,&m,&k)){
memset(sum, 0, sizeof(sum));
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
update(i, a[i]);
}
for(int i=1;i<=m;i++){
scanf("%d%d", &L[i], &R[i]);
}
printf("Case #%d:\n",++kcase);
for(int i=1, op, x, y, tmp;i<=k;i++){
scanf("%d%d%d", &op, &x, &y);
if(1 == op){
a[x]+=y;
update(x, y);
}
else if(2 == op){
a[x]-=y;
update(x, -y);
}
else if(3 == op){
tmp = y-a[x];
a[x] = y;
update(x, tmp);
}
else if(4 == op){
// L[x],R[x],L[y],R[y];
LL ans = 0;
int l1 = L[x], r1= R[x], l2 = L[y], r2 = R[y];
if(l1>l2) swap(l1,l2),swap(r1,r2);
//if(l1 == l2){
// ans = getSum(max(r1,r2))-getSum(l1-1);
//}
//else
if(r1 < l2){ // l1 < l2
ans = getSum(r1)-getSum(l1-1);
ans+= getSum(r2)-getSum(l2-1);
}
else {
ans = getSum(max(r1,r2))-getSum(l1-1);
}
printf("%lld\n",ans);
}
}
}
}
// *****
// *****
//
// *****
// *******
//
// *****
// ***
//
// *****
// ***
void work(){
for(int i=1;i<=10;i++){
stdinout(i, STD);
run();
}
}
int main(){
srand((unsigned)time(NULL));
// work();
run();
return 0;
}