#include <bits/stdc++.h>
const int maxn = 200000 + 10;
const int INF = 0x3f3f3f3f;
struct Gragh {
  struct Edge {
    int v, next;
    Edge() {}
    Edge(int v, int next) : v(v), next(next) {}
  } e[maxn << 1];
  int fir[maxn], ecnt;
  Gragh() {
    memset(fir, 0, sizeof fir);
    ecnt = 0;
  }
  void add(int u, int v) {
    e[++ecnt] = Edge(v, fir[u]);
    fir[u] = ecnt;
  }
  void ins(int u, int v) {
    add(u, v);
    add(v, u);
  }
};
struct SegmentTree {
  int mi[maxn << 2];
  void build(int, int, int);
  void update(int, int, int, int, int);
  int query(int, int, int, int, int);
};
void tarjan(int, int);
void dfs1(int);
void dfs2(int);
int n, m, q, N;
int w[maxn], dfn[maxn], low[maxn], Index;
int stk[maxn], stop;
int top[maxn], size[maxn], fa[maxn], son[maxn], dep[maxn], p[maxn], fp[maxn],
    tn;
SegmentTree sg;
Gragh G, T;
std::multiset<int> ms[maxn];
int main() {
  std::cin >> n >> m >> q;
  N = n;
  for (int i = 1; i <= n; i++) std::cin >> w[i];
  for (int u, v, i = 1; i <= m; i++) {
    std::cin >> u >> v;
    G.ins(u, v);
  }
  tarjan(1, 0);
  dfs1(1);
  top[1] = 1;
  dfs2(1);
  sg.build(1, N, 1);
  char op;
  int a, b, ans;
  while (q--) {
    std::cin >> op >> a >> b;
    if (op == 'C') {
      sg.update(1, N, 1, p[a], b);
      if (fa[a]) {
        ms[fa[a]].erase(ms[fa[a]].find(w[a]));
        ms[fa[a]].insert(b);
        sg.update(1, N, 1, p[fa[a]], *ms[fa[a]].begin());
      }
      w[a] = b;
    } else {
      ans = INF;
      while (top[a] != top[b]) {
        if (dep[top[a]] < dep[top[b]]) std::swap(a, b);
        ans = std::min(ans, sg.query(1, N, 1, p[top[a]], p[a]));
        a = fa[top[a]];
      }
      if (dep[a] > dep[b]) std::swap(a, b);
      ans = std::min(ans, sg.query(1, N, 1, p[a], p[b]));
      if (fa[a] && fa[a] <= n) ans = std::min(ans, w[fa[a]]);
      std::cout << ans << std::endl;
    }
  }
}
void tarjan(int u, int f) {
  dfn[u] = low[u] = ++Index;
  for (int v, i = G.fir[u]; i; i = G.e[i].next) {
    v = G.e[i].v;
    if (v == f) continue;
    if (!dfn[v]) {
      stk[++stop] = v;
      tarjan(v, u);
      low[u] = std::min(low[u], low[v]);
      if (low[v] >= dfn[u]) {
        int p;
        N++;
        do {
          p = stk[stop--];
          T.ins(p, N);
        } while (p != v);
        T.ins(u, N);
      }
    } else
      low[u] = std::min(low[u], dfn[v]);
  }
}
void dfs1(int u) {
  size[u] = 1;
  for (int v, i = T.fir[u]; i; i = T.e[i].next) {
    v = T.e[i].v;
    if (v == fa[u]) continue;
    fa[v] = u;
    dep[v] = dep[u] + 1;
    dfs1(v);
    size[u] += size[v];
    if (size[son[u]] < size[v]) son[u] = v;
    if (u > n) ms[u].insert(w[v]);
  }
}
void dfs2(int u) {
  p[u] = ++tn;
  fp[tn] = u;
  if (son[u]) {
    top[son[u]] = top[u];
    dfs2(son[u]);
  }
  for (int v, i = T.fir[u]; i; i = T.e[i].next) {
    v = T.e[i].v;
    if (v == son[u] || v == fa[u]) continue;
    top[v] = v;
    dfs2(v);
  }
}
void SegmentTree::build(int l, int r, int x) {
  if (l == r) {
    if (fp[l] <= n)
      mi[x] = w[fp[l]];
    else
      mi[x] = *ms[fp[l]].begin();
  } else {
    int mid = (l + r) >> 1;
    build(l, mid, x << 1);
    build(mid + 1, r, x << 1 | 1);
    mi[x] = std::min(mi[x << 1], mi[x << 1 | 1]);
  }
}
void SegmentTree::update(int l, int r, int x, int pos, int val) {
  if (l == r)
    mi[x] = val;
  else {
    int mid = (l + r) >> 1;
    if (pos <= mid)
      update(l, mid, x << 1, pos, val);
    else
      update(mid + 1, r, x << 1 | 1, pos, val);
    mi[x] = std::min(mi[x << 1], mi[x << 1 | 1]);
  }
}
int SegmentTree::query(int l, int r, int x, int ql, int qr) {
  if (ql <= l && r <= qr)
    return mi[x];
  else {
    int mid = (l + r) >> 1, ret = INF;
    if (ql <= mid) ret = std::min(ret, query(l, mid, x << 1, ql, qr));
    if (qr > mid) ret = std::min(ret, query(mid + 1, r, x << 1 | 1, ql, qr));
    return ret;
  }
}
