#include <bits/stdc++.h>
using namespace std;
namespace IO {
const int MAXSIZE = 1 << 18 | 1;
char buf[MAXSIZE], *p1, *p2;
inline int Gc() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
template <class T>
void read(T& x) {
  x = 0;
  int f = 0, ch = Gc();
  while (!isdigit(ch)) {
    f |= ch == '-';
    ch = Gc();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = Gc();
  }
  if (f) x = -x;
}
}  // namespace IO
using IO::Gc;
using IO::read;
const int INF = 0x3f3f3f3f;
const int MAXN = (int)1e5 + 5;
int n, m, q, SqIdx;
int weight[MAXN << 1];
multiset<int> M[MAXN << 1];
struct Edge {
  int from, to;
  Edge(int u, int v) : from(u), to(v) {}
};
struct Graph {
  vector<Edge> edges;
  vector<int> G[MAXN << 1];
  inline void AddEdge(int from, int to) {
    edges.push_back(Edge(from, to));
    int eidx = edges.size() - 1;
    G[from].push_back(eidx);
  }
} G, T;
namespace BCC {
int dfn[MAXN], low[MAXN], dfs_clock;
stack<int> S;
void tarjan(int u) {
  dfn[u] = low[u] = ++dfs_clock;
  S.push(u);
  for (size_t i = 0; i < G.G[u].size(); ++i) {
    int v = G.edges[G.G[u][i]].to;
    if (!dfn[v]) {
      tarjan(v);
      low[u] = min(low[u], low[v]);
      if (low[v] == dfn[u]) {
        ++SqIdx;
        while (true) {
          int x = S.top();
          S.pop();
          T.AddEdge(SqIdx, x);
          T.AddEdge(x, SqIdx);
          if (x == v) break;
        }
        T.AddEdge(SqIdx, u);
        T.AddEdge(u, SqIdx);
      }
    } else
      low[u] = min(low[u], dfn[v]);
  }
}
}  // namespace BCC
namespace HLD {
int son[MAXN << 1], size[MAXN << 1], pre[MAXN << 1], depth[MAXN << 1];
int dfn[MAXN << 1], rnk[MAXN << 1], topfa[MAXN << 1], dfs_clock;
inline void init() {
  dfs_clock = 0;
  memset(son, -1, sizeof son);
}
void dfs1(int u, int fa) {
  size[u] = 1;
  pre[u] = fa;
  depth[u] = depth[fa] + 1;
  for (size_t i = 0; i < T.G[u].size(); ++i) {
    int v = T.edges[T.G[u][i]].to;
    if (v == fa) continue;
    dfs1(v, u);
    size[u] += size[v];
    if (son[u] == -1 || size[son[u]] < size[v]) son[u] = v;
  }
}
void dfs2(int u, int top) {
  dfn[u] = ++dfs_clock;
  rnk[dfs_clock] = u;
  topfa[u] = top;
  if (son[u] == -1) return;
  dfs2(son[u], top);
  for (size_t i = 0; i < T.G[u].size(); ++i) {
    int v = T.edges[T.G[u][i]].to;
    if (v == son[u] || v == pre[u]) continue;
    dfs2(v, v);
  }
}
inline void solve() {
  init();
  dfs1(1, 0);
  dfs2(1, 1);
  for (int i = 1; i <= n; ++i)
    if (pre[i]) M[pre[i]].insert(weight[i]);
  for (int i = n + 1; i <= SqIdx; ++i) weight[i] = *M[i].begin();
}
}  // namespace HLD
namespace SEG {
int datMin[MAXN << 3];
inline void maintain(int nd) {
  datMin[nd] = min(datMin[(nd << 1)], datMin[(nd << 1 | 1)]);
}
void build(int nd, int L, int R) {
  if (L == R) {
    datMin[nd] = weight[HLD::rnk[L]];
    return;
  }
  build((nd << 1), L, (L + ((R - L) >> 1)));
  build((nd << 1 | 1), (L + ((R - L) >> 1)) + 1, R);
  maintain(nd);
}
void modify(int nd, int L, int R, int pos, int val) {
  if (L == R) {
    datMin[nd] = val;
    return;
  }
  if (pos <= (L + ((R - L) >> 1)))
    modify((nd << 1), L, (L + ((R - L) >> 1)), pos, val);
  else
    modify((nd << 1 | 1), (L + ((R - L) >> 1)) + 1, R, pos, val);
  maintain(nd);
}
int query(int nd, int L, int R, int opL, int opR) {
  if (opL <= L && R <= opR) return datMin[nd];
  int ret = INF;
  if (opL <= (L + ((R - L) >> 1)))
    ret = min(query((nd << 1), L, (L + ((R - L) >> 1)), opL, opR), ret);
  if (opR > (L + ((R - L) >> 1)))
    ret = min(query((nd << 1 | 1), (L + ((R - L) >> 1)) + 1, R, opL, opR), ret);
  return ret;
}
}  // namespace SEG
namespace HLD {
int query(int x, int y) {
  int ret = INF;
  while (topfa[x] != topfa[y]) {
    if (depth[topfa[x]] < depth[topfa[y]]) swap(x, y);
    ret = min(ret, SEG::query(1, 1, SqIdx, dfn[topfa[x]], dfn[x]));
    x = pre[topfa[x]];
  }
  if (dfn[x] > dfn[y]) swap(x, y);
  ret = min(ret, SEG::query(1, 1, SqIdx, dfn[x], dfn[y]));
  if (x > n) ret = min(ret, weight[pre[x]]);
  return ret;
}
}  // namespace HLD
int main() {
  read(n);
  read(m);
  read(q);
  SqIdx = n;
  for (int i = 1; i <= n; ++i) read(weight[i]);
  for (int u, v, i = 1; i <= m; ++i) {
    read(u);
    read(v);
    G.AddEdge(u, v);
    G.AddEdge(v, u);
  }
  BCC::tarjan(1);
  HLD::solve();
  SEG::build(1, 1, SqIdx);
  while (q--) {
    int a, b, w, opt = Gc();
    while (isspace(opt)) opt = Gc();
    switch (opt) {
      case 'A':
        read(a);
        read(b);
        printf("%d\n", HLD::query(a, b));
        break;
      case 'C':
        read(a);
        read(w);
        SEG::modify(1, 1, SqIdx, HLD::dfn[a], w);
        if (HLD::pre[a]) {
          int u = HLD::pre[a];
          M[u].erase(M[u].lower_bound(weight[a]));
          M[u].insert(w);
          if (weight[u] != *M[u].begin()) {
            weight[u] = *M[u].begin();
            SEG::modify(1, 1, SqIdx, HLD::dfn[u], weight[u]);
          }
        }
        weight[a] = w;
        break;
      default:
        puts("ERROR");
    }
  }
  return 0;
}
