#include <bits/stdc++.h>
using namespace std;
int gi() {
  char ch = '!';
  int res = 0, f = 0;
  while (ch < '0' || ch > '9') {
    ch = getchar();
    if (ch == '-') f = 1;
  }
  while (ch >= '0' && ch <= '9') res = res * 10 + ch - '0', ch = getchar();
  return f ? -res : res;
}
const int N = 4e5 + 100;
int n, m, cnt, Q, w[N], stk[N], top, low[N], dfn[N], ind[N], Time, dep[N],
    fa[N], bel[N], son[N], sz[N], mn[N << 2];
priority_queue<int, vector<int>, greater<int> > Q1[N], Q2[N];
int head[N], ce;
struct edge {
  int to, nxt;
} e[N << 1];
vector<int> nxt[N];
void lnk(int a, int b) { e[++ce] = (edge){b, head[a]}, head[a] = ce; }
void tarjan(int u) {
  dfn[u] = low[u] = ++Time, stk[++top] = u;
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (!dfn[v]) {
      tarjan(v), low[u] = min(low[u], low[v]);
      if (low[v] == dfn[u]) {
        ++cnt, nxt[cnt].push_back(u), nxt[u].push_back(cnt);
        do {
          nxt[stk[top]].push_back(cnt);
          nxt[cnt].push_back(stk[top]);
        } while (stk[top--] != v);
      }
    } else
      low[u] = min(low[u], dfn[v]);
  }
}
void dfs1(int u, int lst) {
  dep[u] = dep[fa[u]] + 1, sz[u] = 1;
  for (auto v : nxt[u])
    if (v != lst) {
      if (u > n) Q1[u].push(w[v]);
      fa[v] = u, dfs1(v, u), sz[u] += sz[v];
      son[u] = sz[son[u]] > sz[v] ? son[u] : v;
    }
}
void dfs2(int u, int lst) {
  bel[u] = son[lst] == u ? bel[lst] : u;
  dfn[u] = ++Time, ind[Time] = u;
  if (son[u]) dfs2(son[u], u);
  for (auto v : nxt[u])
    if (v != son[u] && v != lst) dfs2(v, u);
}
void init(int k = 1, int l = 1, int r = cnt) {
  if (l == r) {
    if (ind[l] <= n)
      mn[k] = w[ind[l]];
    else
      mn[k] = Q1[ind[l]].top();
    return;
  }
  int mid = (l + r) >> 1;
  init((k << 1), l, mid), init((k << 1 | 1), mid + 1, r);
  mn[k] = min(mn[(k << 1)], mn[(k << 1 | 1)]);
}
void modify(int k, int tar, int val, int l = 1, int r = cnt) {
  if (l == r) return (void)(mn[k] = val);
  int mid = (l + r) >> 1;
  tar <= mid ? modify((k << 1), tar, val, l, mid)
             : modify((k << 1 | 1), tar, val, mid + 1, r);
  mn[k] = min(mn[(k << 1)], mn[(k << 1 | 1)]);
}
int query(int k, int ql, int qr, int l = 1, int r = cnt) {
  if (ql <= l && r <= qr) return mn[k];
  int mid = (l + r) >> 1, res = 1e9;
  if (ql <= mid) res = query((k << 1), ql, qr, l, mid);
  if (qr > mid) res = min(res, query((k << 1 | 1), ql, qr, mid + 1, r));
  return res;
}
int Query(int x, int y) {
  int res = 1e9;
  while (bel[x] != bel[y]) {
    if (dep[bel[x]] < dep[bel[y]]) swap(x, y);
    res = min(res, query(1, dfn[bel[x]], dfn[x]));
    x = fa[bel[x]];
  }
  if (dep[x] > dep[y]) swap(x, y);
  res = min(res, query(1, dfn[x], dfn[y]));
  if (x > n) res = min(res, w[fa[x]]);
  return res;
}
int main() {
  cnt = n = gi(), m = gi(), Q = gi();
  for (int i = 1; i <= n; ++i) w[i] = gi();
  for (int i = 1; i <= m; ++i) {
    int x = gi(), y = gi();
    lnk(x, y), lnk(y, x);
  }
  tarjan(1);
  Time = 0;
  dfs1(1, 0), dfs2(1, 0), init();
  while (Q--) {
    char op = '!';
    while (op != 'A' && op != 'C') op = getchar();
    int a = gi(), b = gi();
    if (op == 'C') {
      if (fa[a]) {
        Q2[fa[a]].push(w[a]), Q1[fa[a]].push(b);
        while (!Q2[fa[a]].empty() && Q2[fa[a]].top() == Q1[fa[a]].top())
          Q2[fa[a]].pop(), Q1[fa[a]].pop();
        modify(1, dfn[fa[a]], Q1[fa[a]].top());
      }
      modify(1, dfn[a], w[a] = b);
    } else
      printf("%d\n", Query(a, b));
  }
  return 0;
}
