#include <bits/stdc++.h>
using namespace std;
multiset<int> F[400010];
int n, m, q, op, len = 0, lena = 0, lenb = 0;
int val[400010], lasta[400010], lastb[400010], sta[400010], dfn[400010],
    low[400010];
int top[400010], dep[400010], size[400010], fa[400010], son[400010], id[400010];
struct node1 {
  int x, y, next;
} a[800010], b[800010];
struct node2 {
  int l, r, lc, rc, mi;
} tr[800010];
void insa(int x, int y) {
  a[++lena] = (node1){x, y, lasta[x]};
  lasta[x] = lena;
}
void insb(int x, int y) {
  b[++lenb] = (node1){x, y, lastb[x]};
  lastb[x] = lenb;
}
int TOP = 0, cnt = 0;
void tarjan(int x) {
  dfn[x] = low[x] = ++cnt;
  sta[++TOP] = x;
  for (int i = lastb[x]; i; i = b[i].next) {
    int y = b[i].y;
    if (!dfn[y]) {
      tarjan(y);
      low[x] = min(low[x], low[y]);
      if (low[y] >= dfn[x]) {
        op++, insa(op, x), insa(x, op);
        int tmp;
        do {
          tmp = sta[TOP--];
          insa(op, tmp), insa(tmp, op);
        } while (tmp != y);
      }
    } else
      low[x] = min(low[x], dfn[y]);
  }
}
void dfs1(int x) {
  size[x] = 1;
  for (int i = lasta[x]; i; i = a[i].next) {
    int y = a[i].y;
    if (y == fa[x]) continue;
    dep[y] = dep[x] + 1;
    fa[y] = x;
    if (x > n) F[x].insert(val[y]);
    dfs1(y);
    size[x] += size[y];
    if (size[y] > size[son[x]]) son[x] = y;
  }
}
int cntt = 0;
void dfs2(int x, int tp) {
  id[x] = ++cntt;
  top[x] = tp;
  if (son[x]) dfs2(son[x], tp);
  for (int i = lasta[x]; i; i = a[i].next) {
    int y = a[i].y;
    if (y == fa[x] || y == son[x]) continue;
    dfs2(y, y);
  }
}
void build(int l, int r) {
  int now = ++len;
  tr[now] = (node2){l, r, -1, -1, 2147483647};
  if (l < r) {
    int mid = (l + r) >> 1;
    tr[now].lc = len + 1;
    build(l, mid);
    tr[now].rc = len + 1;
    build(mid + 1, r);
  }
}
void change(int now, int x, int d) {
  if (tr[now].l == tr[now].r) {
    tr[now].mi = d;
    return;
  }
  int lc = tr[now].lc, rc = tr[now].rc, mid = (tr[now].l + tr[now].r) >> 1;
  if (x <= mid)
    change(lc, x, d);
  else
    change(rc, x, d);
  tr[now].mi = min(tr[lc].mi, tr[rc].mi);
}
int findmin(int now, int l, int r) {
  if (tr[now].l == l && tr[now].r == r) return tr[now].mi;
  int lc = tr[now].lc, rc = tr[now].rc, mid = (tr[now].l + tr[now].r) >> 1;
  if (r <= mid)
    return findmin(lc, l, r);
  else if (l > mid)
    return findmin(rc, l, r);
  else
    return min(findmin(lc, l, mid), findmin(rc, mid + 1, r));
}
int solve(int x, int y) {
  int tx = top[x], ty = top[y];
  int mi = 2147483647;
  while (tx != ty) {
    if (dep[tx] > dep[ty]) swap(x, y), swap(tx, ty);
    mi = min(mi, findmin(1, id[ty], id[y]));
    y = fa[ty];
    ty = top[y];
  }
  if (dep[x] > dep[y]) swap(x, y);
  mi = min(mi, findmin(1, id[x], id[y]));
  if (x > n) mi = min(mi, val[fa[x]]);
  return mi;
}
int main() {
  char s[10];
  int x, y;
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &val[i]);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &x, &y);
    insb(x, y), insb(y, x);
  }
  op = n;
  tarjan(1);
  dfs1(1);
  dfs2(1, 1);
  build(1, op);
  for (int i = 1; i <= n; i++) change(1, id[i], val[i]);
  for (int i = n + 1; i <= op; i++) change(1, id[i], *F[i].begin());
  for (int i = 1; i <= q; i++) {
    scanf("%s %d %d", s + 1, &x, &y);
    if (s[1] == 'C') {
      if (fa[x])
        F[fa[x]].erase(F[fa[x]].lower_bound(val[x])), F[fa[x]].insert(y),
            change(1, id[fa[x]], *F[fa[x]].begin());
      val[x] = y, change(1, id[x], val[x]);
    } else {
      printf("%d\n", solve(x, y));
    }
  }
}
