#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int n, m, q, FANG;
int a[200010], b[200010];
int dfn[100010], low[100010], sta[100010], statop, dfs_clock;
int lastG[100010], lastT[200010], numG, numT;
int fa[200010], size[200010], top[200010], dep[200010], son[200010], id[200010],
    _id[200010];
multiset<int> w[200010];
char str[10];
struct EDGE {
  int ver, next;
} edgeG[200010], edgeT[400010];
struct SegmentTree {
  int l, r, Min;
} st[800010];
inline int read() {
  int x = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return w ? -x : x;
}
void addG(int U, int V) {
  edgeG[++numG] = (EDGE){V, lastG[U]};
  lastG[U] = numG;
}
void addT(int U, int V) {
  edgeT[++numT] = (EDGE){V, lastT[U]};
  lastT[U] = numT;
}
void tarjan(int x) {
  dfn[x] = low[x] = ++dfs_clock;
  sta[++statop] = x;
  for (int i = lastG[x], y = edgeG[i].ver; i;
       i = edgeG[i].next, y = edgeG[i].ver)
    if (!dfn[y]) {
      tarjan(y);
      low[x] = min(low[x], low[y]);
      if (dfn[x] <= low[y]) {
        ++FANG;
        for (; sta[statop] != y; statop--) {
          addT(FANG, sta[statop]);
          addT(sta[statop], FANG);
        }
        statop--;
        addT(y, FANG);
        addT(FANG, y);
        addT(x, FANG);
        addT(FANG, x);
      }
    } else
      low[x] = min(low[x], dfn[y]);
}
void dfs(int x, int F) {
  size[x] = 1;
  for (int i = lastT[x], y = edgeT[i].ver; i;
       i = edgeT[i].next, y = edgeT[i].ver) {
    if (y == F) continue;
    dep[y] = dep[fa[y] = x] + 1;
    dfs(y, x);
    size[x] += size[y];
    if (size[y] > size[son[x]]) son[x] = y;
  }
}
void dfs(int x, int F, int Top) {
  top[_id[id[x] = ++dfs_clock] = x] = Top;
  b[dfs_clock] = a[x];
  if (!son[x]) return;
  dfs(son[x], x, Top);
  for (int i = lastT[x], y = edgeT[i].ver; i;
       i = edgeT[i].next, y = edgeT[i].ver) {
    if (y == F || y == son[x]) continue;
    dfs(y, x, y);
  }
}
int lca(int x, int y) {
  while (top[x] ^ top[y])
    dep[top[x]] >= dep[top[y]] ? x = fa[top[x]] : y = fa[top[y]];
  return dep[x] < dep[y] ? x : y;
}
void build(int p, int l, int r) {
  st[p].l = l;
  st[p].r = r;
  if (l == r) return st[p].Min = b[l], void();
  int mid = (st[p].l + st[p].r) >> 1;
  build(p << 1, l, mid);
  build(p << 1 | 1, mid + 1, r);
  st[p].Min = min(st[p << 1].Min, st[p << 1 | 1].Min);
}
void change(int p, int pos, int val) {
  if (st[p].l == st[p].r) return st[p].Min = val, void();
  int mid = (st[p].l + st[p].r) >> 1;
  if (pos <= mid)
    change(p << 1, pos, val);
  else
    change(p << 1 | 1, pos, val);
  st[p].Min = min(st[p << 1].Min, st[p << 1 | 1].Min);
}
int ask(int p, int l, int r) {
  if (l <= st[p].l && st[p].r <= r) return st[p].Min;
  int mid = (st[p].l + st[p].r) >> 1, Min = inf;
  if (l <= mid) Min = ask(p << 1, l, r);
  if (mid < r) Min = min(Min, ask(p << 1 | 1, l, r));
  return Min;
}
int ask(int x, int y) {
  int Min = inf;
  while (top[x] ^ top[y]) {
    if (dep[top[x]] < dep[top[y]]) swap(x, y);
    Min = min(Min, ask(1, id[top[x]], id[x]));
    x = fa[top[x]];
  }
  if (dep[x] > dep[y]) swap(x, y);
  if (x > n) Min = min(Min, a[fa[x]]);
  return min(Min, ask(1, id[x], id[y]));
}
int main() {
  FANG = n = read();
  m = read();
  q = read();
  memset(a, 0x3f, sizeof a);
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= m; i++) {
    int x = read(), y = read();
    addG(x, y);
    addG(y, x);
  }
  for (int i = 1; i <= n; i++)
    if (!dfn[i]) tarjan(i);
  dfs_clock = 0;
  for (int i = 1; i <= FANG; i++)
    if (!size[i]) {
      dfs(i, 0);
      dfs(i, 0, i);
    }
  build(1, 1, FANG);
  for (int i = 1; i <= n; i++) {
    w[fa[i]].insert(a[i]);
    change(1, id[fa[i]], *w[fa[i]].begin());
  }
  while (q-- > 0) {
    scanf("%s", str + 1);
    if (str[1] == 'C') {
      int x = read(), val = read();
      w[fa[x]].erase(w[fa[x]].lower_bound(a[x]));
      w[fa[x]].insert(a[x] = val);
      change(1, id[x], val);
      change(1, id[fa[x]], *w[fa[x]].begin());
    } else
      printf("%d\n", ask(read(), read()));
  }
}
