#include <bits/stdc++.h>
const int maxn = 2e5 + 1e2;
std::vector<int> T[maxn], G[maxn];
int n, m, q, w[maxn];
int dfn[maxn], low[maxn], ncr, dfc, stk[maxn], top;
void tarjan(int u) {
  low[u] = dfn[u] = ++dfc, stk[++top] = u;
  for (int v : G[u])
    if (!dfn[v]) {
      tarjan(v), low[u] = std::min(low[u], low[v]);
      if (low[v] == dfn[u]) {
        ++ncr;
        for (int x = 0; x != v; --top) {
          x = stk[top], T[ncr].push_back(x), T[x].push_back(ncr);
        }
        T[ncr].push_back(u), T[u].push_back(ncr);
      }
    } else
      low[u] = std::min(low[u], dfn[v]);
}
std::multiset<int> s[maxn];
int tree[maxn << 2];
void update(int x, int l, int r, int pos, int k) {
  if (l == r) {
    tree[x] = k;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    update(x << 1, l, mid, pos, k);
  else
    update(x << 1 | 1, mid + 1, r, pos, k);
  tree[x] = std::min(tree[x << 1], tree[x << 1 | 1]);
}
int query(int x, int l, int r, int ll, int rr) {
  if (ll <= l && r <= rr) return tree[x];
  int mid = (l + r) >> 1, res = 1e9;
  if (ll <= mid) res = std::min(res, query(x << 1, l, mid, ll, rr));
  if (rr > mid) res = std::min(res, query(x << 1 | 1, mid + 1, r, ll, rr));
  return res;
}
int sze[maxn], son[maxn], fat[maxn], dep[maxn];
void DFS1(int u, int fa) {
  fat[u] = fa, sze[u] = 1, dep[u] = dep[fa] + 1;
  for (int v : T[u])
    if (v != fa) {
      DFS1(v, u), sze[u] += sze[v];
      if (sze[son[u]] < sze[v]) son[u] = v;
    }
}
int dft[maxn], ttp[maxn], cnt;
void DFS2(int u, int tp) {
  ttp[u] = tp, dft[u] = ++cnt;
  if (son[u]) DFS2(son[u], tp);
  for (int v : T[u])
    if (v != fat[u] && v != son[u]) DFS2(v, v);
}
inline void init() {
  memset(tree, 63, sizeof tree), std::cin >> n >> m >> q, ncr = n;
  for (int i = 1; i <= n; i++) std::cin >> w[i];
  for (int i = 1, u, v; i <= m; i++)
    std::cin >> u >> v, G[u].push_back(v), G[v].push_back(u);
  tarjan(1), DFS1(1, 0), DFS2(1, 1);
  for (int i = 1; i <= n; i++)
    if (fat[i] && i <= n) s[fat[i]].insert(w[i]);
  for (int i = 1; i <= n; i++) update(1, 1, ncr, dft[i], w[i]);
  for (int i = n + 1; i <= ncr; i++) update(1, 1, ncr, dft[i], *s[i].begin());
}
inline void Modify(int x, int y) {
  if (fat[x])
    s[fat[x]].erase(s[fat[x]].find(w[x])), s[fat[x]].insert(y),
        update(1, 1, ncr, dft[fat[x]], *s[fat[x]].begin());
  w[x] = y, update(1, 1, ncr, dft[x], y);
}
inline int Query(int x, int y) {
  int res = 1e9 + 1e2;
  while (ttp[x] != ttp[y]) {
    if (dep[ttp[x]] < dep[ttp[y]]) std::swap(x, y);
    res = std::min(res, query(1, 1, ncr, dft[ttp[x]], dft[x])), x = fat[ttp[x]];
  }
  if (dep[x] < dep[y]) std::swap(x, y);
  res = std::min(res, query(1, 1, ncr, dft[y], dft[x]));
  if (y > n) res = std::min(res, w[fat[y]]);
  return res;
}
int main() {
  std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
  init();
  while (q--) {
    char op;
    int a, b;
    std::cin >> op >> a >> b;
    if (op == 'C')
      Modify(a, b);
    else
      std::cout << Query(a, b) << std::endl;
  }
  return 0;
}
