import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;
class GSS4 {
static int array[];
// TODO Auto-generated method stub
StringBuilder sb=new StringBuilder();
int test=1;
while(true){
if(s==null || s.equalsIgnoreCase("") || s.equals("\n"))break;
sb.append("Case #"+test++ +":\n");
array=new int[N+1];
for(int i=1;i<=N;i++){
array[i]=r.nextInt();
}
Segment_Tree root=new Segment_Tree(1, N);
int M=r.nextInt();
for(int i=0;i<M;i++){
int choice=r.nextInt();
int low=r.nextInt();
int high=r.nextInt();
if(choice==0){
root.update(low, high);
}
else{
sb.append(root.query(low, high).sum+"\n");
}
}
sb.append("\n");
}
pr.write(sb.toString());
pr.flush();
}
final private int BUFFER_SIZE = 1 << 16;
private byte[] buffer;
private int bufferPointer, bytesRead;
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
byte[] buf = new byte[64];
int cnt = 0, c;
while ((c = read()) != -1) {
if (c == '\n')
break;
buf[cnt++] = (byte) c;
}
return new String(buf,
0, cnt
); }
int ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
long ret = 0;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg)
return -ret;
return ret;
}
double ret = 0, div = 1;
byte c = read();
while (c <= ' ')
c = read();
boolean neg = (c == '-');
if (neg)
c = read();
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (c == '.')
while ((c = read()) >= '0' && c <= '9')
ret += (c - '0') / (div *= 10);
if (neg)
return -ret;
return ret;
}
bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
if (bytesRead == -1)
buffer[0] = -1;
}
if (bufferPointer == bytesRead)
fillBuffer();
return buffer[bufferPointer++];
}
if (din == null)
return;
din.close();
}
}
static class Segment_Tree{
Segment_Tree left_child,right_child;
int start,end;long sum;
long lazy;
public Segment_Tree(){}
public Segment_Tree(int a,int b){
start=a;
end=b;
if(start!=end){
int mid=(start+end)>>1;
left_child=new Segment_Tree(start, mid);
right_child=new Segment_Tree(mid+1, end);
join(this,left_child,right_child);
}
else{
sum=GSS4.array[start];
}
}
public void join(Segment_Tree parent,Segment_Tree left_child,Segment_Tree right_child){
parent.sum=left_child.sum+right_child.sum;
}
public Segment_Tree query(int a,int b){
if(a>b || a<start || b>end)return new Segment_Tree();
if(start==a && end==b)return this;
int mid=(start+end)>>1;
if(a>mid)return right_child.query(a, b);
else if(b<=mid) return left_child.query(a, b);
Segment_Tree ans=new Segment_Tree();
join(ans,left_child.query(a, mid),right_child.query(mid+1, b));
return ans;
}
public void update(int a,int b){
if(a>b || a<start || b>end)return;
if(start!=end){
int mid=(start+end)>>1;
left_child.update(a, mid);
right_child.update(mid+1, b);
join(this, left_child, right_child);
}
else{
this.
sum=(long)Math.
sqrt(this.
sum); }
}
}
}