#include <bits/stdc++.h>
using std::max;
using std::min;
using std::multiset;
using std::sort;
using std::swap;
const int maxn = 200007;
const int maxm = 400007;
const int inf = 0x7f7f7f7f;
struct E {
  int v;
};
struct Graph {
  E e[maxm];
  int first[maxn], nt[maxm], ES;
  inline void addE(int u, int v) {
    e[++ES] = (E){v};
    nt[ES] = first[u];
    first[u] = ES;
    return;
  }
} T, G;
int N, M, cnt, Q;
int dfn[maxn], low[maxn], ix;
int stk[maxn], Top;
int A[maxn];
multiset<int> s[maxn];
void tarjan(int u) {
  low[u] = dfn[u] = ++ix;
  stk[++Top] = u;
  for (int v, i = G.first[u]; i; i = G.nt[i]) {
    v = G.e[i].v;
    if (!dfn[v]) {
      tarjan(v);
      low[u] = min(low[u], low[v]);
      if (low[v] == dfn[u]) {
        ++cnt;
        int p;
        do {
          p = stk[Top--];
          T.addE(p, cnt);
          T.addE(cnt, p);
        } while (p != v);
        T.addE(cnt, u);
        T.addE(u, cnt);
      }
    } else
      low[u] = min(low[u], dfn[v]);
  }
  return;
}
int dep[maxn], sz[maxn], son[maxn], fa[maxn];
void dfs(int u) {
  sz[u] = 1;
  for (int v, i = T.first[u]; i; i = T.nt[i]) {
    v = T.e[i].v;
    if (v == fa[u]) continue;
    dep[v] = dep[u] + 1;
    fa[v] = u;
    dfs(v);
    if (u > N) s[u].insert(A[v]);
    sz[u] += sz[v];
    if (sz[v] > sz[son[u]]) son[u] = v;
  }
  if (u > N && !s[u].empty()) A[u] = *s[u].begin();
  return;
}
int top[maxn], id[maxn], anti[maxn];
void dfs(int u, int tp) {
  top[u] = tp;
  anti[id[u] = ++ix] = u;
  if (son[u]) dfs(son[u], tp);
  for (int v, i = T.first[u]; i; i = T.nt[i]) {
    v = T.e[i].v;
    if (v == fa[u] || v == son[u]) continue;
    dfs(v, v);
  }
  return;
}
int mn[maxn << 2];
void build(int L, int R, int i) {
  if (L == R) {
    mn[i] = A[anti[L]];
    return;
  }
  int mid = L + R >> 1;
  build(L, mid, (i << 1));
  build(mid + 1, R, (i << 1 | 1));
  mn[i] = min(mn[(i << 1)], mn[(i << 1 | 1)]);
  return;
}
void update(int L, int R, int x, int k, int i) {
  if (L == R) {
    mn[i] = (A[anti[L]] = k);
    return;
  }
  int mid = L + R >> 1;
  if (x <= mid)
    update(L, mid, x, k, (i << 1));
  else
    update(mid + 1, R, x, k, (i << 1 | 1));
  mn[i] = min(mn[(i << 1)], mn[(i << 1 | 1)]);
  return;
}
int query(int L, int R, int l, int r, int i) {
  if (l <= L && R <= r) return mn[i];
  int re = inf, mid = L + R >> 1;
  if (l <= mid) re = min(re, query(L, mid, l, r, (i << 1)));
  if (r > mid) re = min(re, query(mid + 1, R, l, r, (i << 1 | 1)));
  return re;
}
int query(int x, int y) {
  int re = inf;
  while (top[x] != top[y]) {
    if (dep[top[x]] < dep[top[y]]) swap(x, y);
    re = min(re, query(1, cnt, id[top[x]], id[x], 1));
    x = fa[top[x]];
  }
  if (dep[x] > dep[y]) swap(x, y);
  re = min(re, query(1, cnt, id[x], id[y], 1));
  if (x > N) re = min(re, A[fa[x]]);
  return re;
}
int main() {
  scanf("%d%d%d", &N, &M, &Q);
  cnt = N;
  for (int i = 1; i <= N; i++) scanf("%d", &A[i]);
  int u, v;
  for (int i = 1; i <= M; i++) {
    scanf("%d%d", &u, &v);
    G.addE(u, v);
    G.addE(v, u);
  }
  for (int i = 1; i <= N; i++)
    if (!dfn[i]) tarjan(i);
  ix = 0;
  dfs(1);
  dfs(1, 1);
  build(1, cnt, 1);
  char src[7];
  multiset<int>::iterator it;
  while (Q--) {
    scanf("%s", src + 1);
    scanf("%d%d", &u, &v);
    if (src[1] == 'C') {
      if (fa[u] > N) {
        it = s[fa[u]].lower_bound(A[u]);
        s[fa[u]].erase(it);
        s[fa[u]].insert(A[u] = v);
        update(1, cnt, id[fa[u]], *s[fa[u]].begin(), 1);
      }
      update(1, cnt, id[u], v, 1);
    } else
      printf("%d\n", query(u, v));
  }
  return 0;
}
