#include<queue>
#include<cstdio>
#include<cctype>
#include<vector>
#include<cstring>
#include<algorithm>
#define lc (x<<1)
#define rc (x<<1|1)
using namespace std;
inline char gc(){
static char now[1<<16],*S,*T;
if (T==S){T=(S=now)+fread(now,1,1<<16,stdin);if (T==S) return EOF;}
return *S++;
}
inline int read(){
int x=0,f=1;char ch=gc();
while(!isdigit(ch)) {if (ch=='-') f=-1;ch=gc();}
while(isdigit(ch)) x=x*10+ch-'0',ch=gc();
return x*f;
}
const int N=2e5+10;
const int inf=0x3f3f3f3f;
struct node1{
priority_queue<int,vector<int>,greater<int> >q1,q2;
inline void push(int x){q1.push(x);}
inline void erase(int x){q2.push(x);}
inline int top(){
while(!q2.empty()&&q1.top()==q2.top()) q1.pop(),q2.pop();
if (q1.empty()) return -1;return q1.top();
}
}Q[N<<1];
struct node{
int x,y,next;
}data[N],data1[N<<1];
int h[N],q[N],top,h1[N],fa[N],dep[N],w[N],num,cnt,low[N],dfn[N],tot,n,m;
int size[N],id[N],qq,son[N],tp[N],mn[N<<2];
inline void insert1(int x,int y){
data1[++cnt].y=y;data1[cnt].next=h1[x];h1[x]=cnt;data1[cnt].x=x;
data1[++cnt].y=x;data1[cnt].next=h1[y];h1[y]=cnt;data1[cnt].x=y;
}
inline void tarjan(int x){
dfn[x]=low[x]=++num;q[++top]=x;
for (int i=h[x];i;i=data[i].next){
int y=data[i].y;
if (!dfn[y]){
tarjan(y);low[x]=min(low[x],low[y]);
if (low[y]>=dfn[x]){
insert1(++tot,x);int v;
do{
v=q[top--];insert1(v,tot);
}while(v!=y);
}
}else low[x]=min(low[x],dfn[y]);
}
}
inline void dfs(int x){
size[x]=1;if (x<=n&&fa[x]) Q[fa[x]].push(w[x]);
for (int i=h1[x];i;i=data1[i].next){
int y=data1[i].y;if (y==fa[x]) continue;
fa[y]=x;dep[y]=dep[x]+1;dfs(y);size[x]+=size[y];
if (size[y]>size[son[x]]) son[x]=y;
}
}
inline void dfs1(int x,int top){
tp[x]=top;dfn[x]=++num;id[num]=x;
if(son[x]) dfs1(son[x],top);
for (int i=h1[x];i;i=data1[i].next){
int y=data1[i].y;if (y==fa[x]||y==son[x]) continue;
dfs1(y,y);
}
}
inline void build(int x,int l,int r){
if (l==r) {mn[x]=id[l]>n?Q[id[l]].top():w[id[l]];return;}
int mid=l+r>>1;
build(lc,l,mid);build(rc,mid+1,r);mn[x]=min(mn[lc],mn[rc]);
}
inline void modify(int x,int l,int r,int p,int v){
if (l==r) {mn[x]=v;return;}int mid=l+r>>1;
if (p<=mid) modify(lc,l,mid,p,v);
else modify(rc,mid+1,r,p,v);mn[x]=min(mn[lc],mn[rc]);
}
inline int query(int x,int l,int r,int l1,int r1){
if (l1<=l&&r1>=r) return mn[x];int mid=l+r>>1,tmp=inf;
if (l1<=mid) tmp=min(tmp,query(lc,l,mid,l1,r1));
if (r1>mid) tmp=min(tmp,query(rc,mid+1,r,l1,r1));return tmp;
}
int main(){
freopen("uoj30.in","r",stdin);
n=read();m=read();qq=read();tot=n;
for (int i=1;i<=n;++i) w[i]=read();
for (int i=1;i<=m;++i){
int x=read(),y=read();
data[++num].y=y;data[num].next=h[x];h[x]=num;
data[++num].y=x;data[num].next=h[y];h[y]=num;
}num=0;for (int i=1;i<=n;++i) if (!dfn[i]) tarjan(i);
dfs(1);num=0;memset(dfn,0,sizeof(dfn));
dfs1(1,1);build(1,1,tot);
for (int owo=1;owo<=qq;++owo){
char op=gc();while(op!='A'&&op!='C') op=gc();
if (op=='A'){
int x=read(),y=read(),ans=inf;
while(tp[x]!=tp[y]){
if (dep[tp[x]]<dep[tp[y]]) swap(x,y);
ans=min(ans,query(1,1,tot,dfn[tp[x]],dfn[x]));
x=fa[tp[x]];
}
if (dfn[x]>dfn[y]) swap(x,y);
ans=min(ans,query(1,1,tot,dfn[x],dfn[y]));
if (x>n) ans=min(ans,query(1,1,tot,dfn[fa[x]],dfn[fa[x]]));
printf("%d\n",ans);
}
if (op=='C'){
int a=read(),v=read();
if (fa[a]) Q[fa[a]].erase(w[a]);
w[a]=v;modify(1,1,tot,dfn[a],w[a]);
if (fa[a]) Q[fa[a]].push(w[a]),modify(1,1,tot,dfn[fa[a]],Q[fa[a]].top());
}
}
return 0;
}