#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int maxm = 1e5 + 10;
int n, m, Q, cnt_edge, num;
int head[maxn], val[maxn];
multiset<int> s[maxn];
struct edge {
  int to, nxt;
} e[maxm << 1];
inline int read() {
  char c = getchar();
  int res = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') res = res * 10 + c - '0', c = getchar();
  return res * f;
}
inline void add_edge(int u, int v) {
  e[++cnt_edge].nxt = head[u];
  head[u] = cnt_edge;
  e[cnt_edge].to = v;
}
namespace Tree {
int cnt_edge, tim;
int head[maxn], size[maxn], pre[maxn], dep[maxn], son[maxn], top[maxn],
    dfn[maxn], pos[maxn];
struct edge {
  int to, nxt;
} e[maxn << 1];
inline void add_edge(int u, int v) {
  e[++cnt_edge].nxt = head[u];
  head[u] = cnt_edge;
  e[cnt_edge].to = v;
}
void dfs1(int x, int fa) {
  size[x] = 1;
  dep[x] = dep[fa] + 1;
  pre[x] = fa;
  if (x <= n && fa) s[fa].insert(val[x]);
  for (int i = head[x]; i; i = e[i].nxt) {
    int y = e[i].to;
    if (y == fa) continue;
    dfs1(y, x);
    size[x] += size[y];
    if (size[y] > size[son[x]]) son[x] = y;
  }
}
void dfs2(int x, int tp) {
  dfn[x] = ++tim;
  pos[tim] = x;
  top[x] = tp;
  if (son[x]) dfs2(son[x], tp);
  for (int i = head[x]; i; i = e[i].nxt) {
    int y = e[i].to;
    if (y == pre[x] || y == son[x]) continue;
    dfs2(y, y);
  }
}
int minn[maxn << 2];
inline void up(int p) { minn[p] = min(minn[(p << 1)], minn[(p << 1 | 1)]); }
void build(int p, int l, int r) {
  if (l == r) {
    minn[p] = val[pos[l]];
    return;
  }
  int mid = (l + r) >> 1;
  build((p << 1), l, mid);
  build((p << 1 | 1), mid + 1, r);
  up(p);
}
void change(int p, int l, int r, int pos, int k) {
  if (l == r) {
    minn[p] = k;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    change((p << 1), l, mid, pos, k);
  else
    change((p << 1 | 1), mid + 1, r, pos, k);
  up(p);
}
int query(int p, int l, int r, int ql, int qr) {
  if (l >= ql && r <= qr) return minn[p];
  int mid = (l + r) >> 1, res = 1e9;
  if (ql <= mid) res = min(res, query((p << 1), l, mid, ql, qr));
  if (qr > mid) res = min(res, query((p << 1 | 1), mid + 1, r, ql, qr));
  return res;
}
inline void change(int x, int k) {
  if (pre[x]) {
    s[pre[x]].erase(s[pre[x]].find(val[x]));
    s[pre[x]].insert(k);
    change(1, 1, num, dfn[pre[x]], *s[pre[x]].begin());
  }
  val[x] = k;
  change(1, 1, num, dfn[x], val[x]);
}
inline int query(int x, int y) {
  int res = 1e9;
  while (top[x] != top[y]) {
    if (dep[top[x]] < dep[top[y]]) swap(x, y);
    res = min(res, query(1, 1, num, dfn[top[x]], dfn[x]));
    x = pre[top[x]];
  }
  if (dep[x] > dep[y]) swap(x, y);
  res = min(res, query(1, 1, num, dfn[x], dfn[y]));
  if (x <= n)
    return res;
  else
    return min(res, val[pre[x]]);
}
}  // namespace Tree
int tim, top;
int dfn[maxn], low[maxn], sta[maxn];
void tarjan(int x) {
  dfn[x] = low[x] = ++tim;
  sta[++top] = x;
  for (int i = head[x]; i; i = e[i].nxt) {
    int y = e[i].to;
    if (!dfn[y]) {
      tarjan(y);
      low[x] = min(low[x], low[y]);
      if (dfn[x] == low[y]) {
        num++;
        Tree::add_edge(num, x), Tree::add_edge(x, num);
        int z;
        do {
          z = sta[top--];
          Tree::add_edge(num, z), Tree::add_edge(z, num);
        } while (z != y);
      }
    } else
      low[x] = min(low[x], dfn[y]);
  }
}
int main() {
  num = n = read(), m = read(), Q = read();
  val[0] = 1e9;
  for (int i = 1; i <= n; i++) val[i] = read();
  for (int i = 1; i <= m; i++) {
    int u = read(), v = read();
    add_edge(u, v);
    add_edge(v, u);
  }
  tarjan(1);
  Tree::dfs1(1, 0);
  Tree::dfs2(1, 1);
  for (int i = n + 1; i <= num; i++) val[i] = *s[i].begin();
  Tree::build(1, 1, num);
  while (Q--) {
    char op[5];
    scanf("%s", op);
    int x = read(), y = read();
    if (op[0] == 'C')
      Tree::change(x, y);
    else
      printf("%d\n", Tree::query(x, y));
  }
  return 0;
}
