#include <bits/stdc++.h>
using namespace std;
stack<int> stk;
multiset<int> st[200010];
char op[5];
int n, minn[800010], fa[200010], dep[200010], top[200010], sz[200010],
    son[200010], id[200010], pos[200010], dfn[100010], low[100010], a[200010],
    head[100010], to[200010], nxt[200010], head2[200010], to2[200010],
    nxt2[200010], tot, tot2, bcc_tot;
void addedge(int u, int v) {
  to[++tot] = v;
  nxt[tot] = head[u];
  head[u] = tot;
}
void addedge2(int u, int v) {
  to2[++tot2] = v;
  nxt2[tot2] = head2[u];
  head2[u] = tot2;
}
void dfs(int u, int f) {
  dfn[u] = low[u] = ++tot;
  stk.push(u);
  for (int i = head[u]; i; i = nxt[i]) {
    int v = to[i];
    if (!dfn[v]) {
      dfs(v, u);
      low[u] = min(low[u], low[v]);
      if (low[v] == dfn[u]) {
        bcc_tot++;
        addedge2(u, n + bcc_tot);
        fa[n + bcc_tot] = u;
        for (int w = 0; w != v;) {
          w = stk.top();
          stk.pop();
          addedge2(n + bcc_tot, w);
          fa[w] = n + bcc_tot;
        }
      }
    } else
      low[u] = min(low[u], dfn[v]);
  }
}
void dfs2(int u) {
  sz[u] = 1;
  for (int i = head2[u]; i; i = nxt2[i]) {
    int v = to2[i];
    if (v == fa[u]) continue;
    dep[v] = dep[u] + 1;
    dfs2(v);
    sz[u] += sz[v];
    if (sz[son[u]] < sz[v]) son[u] = v;
  }
}
void dfs3(int u) {
  id[u] = ++tot;
  pos[tot] = u;
  if (u == son[fa[u]])
    top[u] = top[fa[u]];
  else
    top[u] = u;
  if (son[u]) dfs3(son[u]);
  for (int i = head2[u]; i; i = nxt2[i]) {
    int v = to2[i];
    if (v != fa[u] && v != son[u]) dfs3(v);
  }
}
void build(int rt, int l, int r) {
  if (l == r) return minn[rt] = a[pos[l]], void();
  int mid = (l + r) / 2;
  build(rt * 2, l, mid);
  build(rt * 2 + 1, mid + 1, r);
  minn[rt] = min(minn[rt * 2], minn[rt * 2 + 1]);
}
void update(int rt, int l, int r, int x, int y) {
  if (l == r) return minn[rt] = y, void();
  int mid = (l + r) / 2;
  if (x <= mid)
    update(rt * 2, l, mid, x, y);
  else
    update(rt * 2 + 1, mid + 1, r, x, y);
  minn[rt] = min(minn[rt * 2], minn[rt * 2 + 1]);
}
int query(int rt, int l, int r, int x, int y) {
  if (l > y || r < x) return 1e9;
  if (x <= l && r <= y) return minn[rt];
  int mid = (l + r) / 2;
  return min(query(rt * 2, l, mid, x, y), query(rt * 2 + 1, mid + 1, r, x, y));
}
int main() {
  int m, q, u, v;
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    addedge(u, v);
    addedge(v, u);
  }
  tot = 0;
  dfs(1, 0);
  for (int i = n + 1; i <= n + bcc_tot; i++) {
    a[i] = 1e9;
    for (int j = head2[i]; j; j = nxt2[j])
      st[i].insert(a[to2[j]]), a[i] = min(a[i], a[to2[j]]);
  }
  tot = 0;
  dfs2(1);
  dfs3(1);
  build(1, 1, n + bcc_tot);
  while (q--) {
    scanf("%s%d%d", op, &u, &v);
    if (op[0] == 'C') {
      update(1, 1, n + bcc_tot, id[u], v);
      if (fa[u]) {
        st[fa[u]].erase(st[fa[u]].find(a[u]));
        st[fa[u]].insert(v);
        a[fa[u]] = *st[fa[u]].begin();
        update(1, 1, n + bcc_tot, id[fa[u]], a[fa[u]]);
      }
      a[u] = v;
    } else {
      int ans = 1e9;
      while (top[u] != top[v]) {
        if (dep[top[u]] < dep[top[v]]) swap(u, v);
        ans = min(ans, query(1, 1, n + bcc_tot, id[top[u]], id[u]));
        u = fa[top[u]];
      }
      if (dep[u] > dep[v]) swap(u, v);
      ans = min(ans, query(1, 1, n + bcc_tot, id[u], id[v]));
      if (u > n) ans = min(ans, query(1, 1, n + bcc_tot, id[fa[u]], id[fa[u]]));
      printf("%d\n", ans);
    }
  }
  return 0;
}
