#include <bits/stdc++.h>
using namespace std;
int P1 = 1000000, P2 = 0;
char buf[1000005], wb[1000005];
int gc() {
  if (P1 >= 1000000) fread(buf, 1, 1000000, stdin), P1 = 0;
  return buf[P1++];
}
long long getint() {
  long long ret = 0, flag = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') flag = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    ret = (ret << 3) + (ret << 1) + c - '0';
    c = getchar();
  }
  return ret * flag;
}
void pc(char x) {
  if (P2 >= 1000000) fwrite(wb, 1, 1000000, stdout), P2 = 0;
  wb[P2++] = x;
}
void wrt(long long x) {
  if (x < 0) pc('-'), x = -x;
  int c[24] = {0};
  if (!x) return pc('0'), void();
  while (x) c[++c[0]] = x % 10, x /= 10;
  while (c[0]) pc(c[c[0]--] + '0');
}
int n, m, Q, tot;
struct edge {
  int ne, v;
} e[800005];
int head[400005], cnt = 1;
void add(int u, int v) {
  ++cnt;
  e[cnt].v = v;
  e[cnt].ne = head[u];
  head[u] = cnt;
}
int dfn[400005], low[400005], sign, tg[400005], w[400005];
vector<int> vec[400005], G[400005];
map<int, int> vis[400005];
multiset<int> p[400005];
stack<int> s;
void tarjan(int x) {
  dfn[x] = low[x] = ++sign, s.push(x);
  int sz = vec[x].size();
  for (int i = 0; i < sz; i++) {
    int y = vec[x][i];
    if (!dfn[y]) {
      tarjan(y), low[x] = min(low[x], low[y]);
      if (low[y] == dfn[x]) {
        ++tot;
        do {
          add(tot, s.top()), add(s.top(), tot);
          p[tot].insert(w[s.top()]);
          G[tot].push_back(s.top());
          if (s.top() == y) {
            s.pop();
            break;
          }
          s.pop();
        } while (1);
        add(x, tot), add(tot, x), w[tot] = *p[tot].begin();
        tg[tot] = (G[tot].size() == 1) && (vis[x][G[tot][0]] == 1);
      }
    } else
      low[x] = min(low[x], dfn[y]);
  }
}
int sz[400005], son[400005], dep[400005], fa[400005];
void dfs1(int x, int prt) {
  sz[x] = 1, fa[x] = prt, dep[x] = dep[prt] + 1;
  for (int i = head[x]; i; i = e[i].ne) {
    int y = e[i].v;
    if (y == prt) continue;
    dfs1(y, x), sz[x] += sz[y];
    if (sz[son[x]] < sz[y]) son[x] = y;
  }
}
int tp[400005], rd[400005], cd[400005], ind[400005];
void dfs2(int x, int prt, int top) {
  ind[rd[x] = ++sign] = x, tp[x] = top;
  if (son[x]) dfs2(son[x], x, top);
  for (int i = head[x]; i; i = e[i].ne) {
    int y = e[i].v;
    if (y == prt || y == son[x]) continue;
    dfs2(y, x, y);
  }
  cd[x] = sign;
}
struct Segment_tree {
  struct node {
    int l, r;
    int val;
  } v[1600005];
  void build(int rt, int l, int r) {
    v[rt].l = l, v[rt].r = r;
    if (l == r) {
      v[rt].val = w[ind[l]];
      return;
    }
    int mid = (l + r) >> 1;
    build(rt << 1, l, mid);
    build(rt << 1 | 1, mid + 1, r);
    v[rt].val = min(v[rt << 1].val, v[rt << 1 | 1].val);
  }
  int ask(int rt, int l, int r) {
    if (l <= v[rt].l && v[rt].r <= r) return v[rt].val;
    int ret = 0x3f3f3f3f, mid = v[rt << 1].r;
    if (l <= mid) ret = min(ret, ask(rt << 1, l, r));
    if (mid < r) ret = min(ret, ask(rt << 1 | 1, l, r));
    return ret;
  }
  void update(int rt, int p) {
    if (v[rt].l == v[rt].r) {
      v[rt].val = w[ind[v[rt].l]];
      return;
    }
    int mid = v[rt << 1].r;
    update(p <= mid ? rt << 1 : rt << 1 | 1, p);
    v[rt].val = min(v[rt << 1].val, v[rt << 1 | 1].val);
  }
} S;
int ask(int x, int y) {
  int ret = 0x3f3f3f3f;
  while (tp[x] ^ tp[y]) {
    if (dep[tp[x]] < dep[tp[y]]) swap(x, y);
    ret = min(ret, S.ask(1, rd[tp[x]], rd[x]));
    x = fa[tp[x]];
  }
  if (rd[x] > rd[y]) swap(x, y);
  ret = min(ret, S.ask(1, rd[x], rd[y]));
  return x <= n ? ret : min(ret, w[fa[x]]);
}
int main() {
  tot = n = getint();
  m = getint();
  Q = getint();
  for (int i = 1; i <= n; i++) w[i] = getint();
  for (int i = 1; i <= m; i++) {
    int u = getint(), v = getint();
    ++vis[u][v], ++vis[v][u];
    vec[u].push_back(v), vec[v].push_back(u);
  }
  tarjan(1), sign = 0;
  dfs1(1, 0), dfs2(1, 0, 1);
  S.build(1, 1, sign);
  for (int i = 1; i <= Q; i++) {
    char c = getchar();
    while (c != 'C' && c != 'A') c = getchar();
    if (c == 'C') {
      int x = getint(), val = getint();
      if (fa[x]) {
        p[fa[x]].erase(p[fa[x]].find(w[x]));
        p[fa[x]].insert(val);
        w[fa[x]] = *p[fa[x]].begin();
        S.update(1, rd[fa[x]]);
      }
      w[x] = val;
      S.update(1, rd[x]);
    }
    if (c == 'A') {
      int x = getint(), y = getint();
      wrt(ask(x, y)), pc('\n');
    }
  }
  fwrite(wb, 1, P2, stdout);
  return 0;
}
