#include <bits/stdc++.h>
#define N 10005
using namespace std;
struct node{
int l,r,mid,minn;
}tree[N<<2];
int a[N];
void build(int m,int l,int r){
tree[m].l = l;
tree[m].r = r;
tree[m].mid = (l+r)>>1;
if(l == r){
tree[m].minn = a[l];
return;
}
build(m<<1,l,tree[m].mid);
build((m<<1)+1,tree[m].mid+1,r);
tree[m].minn = min(tree[m<<1].minn,tree[(m<<1)+1].minn);
}
void update(int m,int a,int val){
if(tree[m].l == a && tree[m].r == a){
tree[m].minn = val;
return;
}
if(a <= tree[m].mid)
update(m<<1,a,val);
else
update((m<<1)+1,a,val);
tree[m].minn = min(tree[m<<1].minn,tree[(m<<1)+1].minn);
}
int query(int m,int l,int r){
if(l == tree[m].l && r == tree[m].r)
return tree[m].minn;
if(r <= tree[m].mid)
return query(m<<1,l,r);
if(l > tree[m].mid)
return query((m<<1)+1,l,r);
return min(query(m<<1,l,tree[m].mid),query((m<<1)+1,tree[m].mid+1,r));
}
int main(){
int n,m;
while(scanf("%d",&n) != EOF){
for(int i = 1; i <= n; i++)
scanf("%d",&a[i]);
build(1,1,n);
scanf("%d",&m);
int op,x,y;
for(int i = 0; i < m; i++){
scanf("%d%d%d",&op,&x,&y);
if(op == 0)
printf("%d\n",query(1,x,y));
else
update(1,x,y);
}
}
return 0;
}