#include <bits/stdc++.h>
using namespace std;
void chkmi(int &x, int y) {
  if (x > y) x = y;
}
void chkmx(int &x, int y) {
  if (x < y) x = y;
}
int Head[100005], E[100005 << 1], Nxt[100005 << 1], tol;
void Edge(int x, int y) {
  E[tol] = y;
  Nxt[tol] = Head[x];
  Head[x] = tol++;
}
struct Heap {
  priority_queue<int, vector<int>, greater<int> > Q;
  priority_queue<int, vector<int>, greater<int> > P;
  void pop(int x) { P.push(x); }
  void push(int x) { Q.push(x); }
  int top() {
    while (!P.empty() && Q.top() == P.top()) Q.pop(), P.pop();
    return Q.top();
  }
} Heap[100005 << 1];
int n, m, q;
vector<int> G[100005 << 1];
vector<int> col[100005];
int dfn[100005], low[100005], Stk[100005];
int dfn_cnt, Stk_top, bcc_id;
void Tarjan(int x) {
  dfn[x] = low[x] = ++dfn_cnt;
  Stk[++Stk_top] = x;
  for (int i = Head[x]; ~i; i = Nxt[i]) {
    int y = E[i];
    if (!dfn[y]) {
      Tarjan(y);
      chkmi(low[x], low[y]);
      if (low[y] >= dfn[x]) {
        bcc_id++;
        while (Stk_top) {
          int k = Stk[Stk_top--];
          G[bcc_id].push_back(k);
          G[k].push_back(bcc_id);
          if (k == y) break;
        }
        G[bcc_id].push_back(x);
        G[x].push_back(bcc_id);
      }
    } else
      chkmi(low[x], dfn[y]);
  }
}
int dep[100005 << 1], Fa[100005 << 1], Top[100005 << 1], sz[100005 << 1],
    son[100005 << 1];
int SgId[100005 << 1], SgId_cnt;
void dfs(int x, int fr) {
  dep[x] = dep[fr] + 1;
  Fa[x] = fr;
  sz[x] = 1;
  son[x] = 0;
  for (int i = (0), _t = (G[x].size() - 1); i <= _t; ++i) {
    int y = G[x][i];
    if (y == fr) continue;
    dfs(y, x);
    sz[x] += sz[y];
    if (sz[y] > sz[son[x]]) son[x] = y;
  }
}
void DFS(int x, int tp) {
  Top[x] = tp;
  SgId[x] = ++SgId_cnt;
  if (son[x]) DFS(son[x], tp);
  for (int i = (0), _t = (G[x].size() - 1); i <= _t; ++i) {
    int y = G[x][i];
    if (y == Fa[x] || y == son[x]) continue;
    DFS(y, y);
  }
}
int val[100005];
int mn[100005 << 3], num[100005 << 1];
void build(int L, int R, int p) {
  if (L == R) {
    mn[p] = num[L];
    return;
  }
  int mid = L + R >> 1;
  build(L, mid, p << 1);
  build(mid + 1, R, p << 1 | 1);
  mn[p] = min(mn[p << 1], mn[p << 1 | 1]);
}
void Update(int L, int R, int p, int x, int v) {
  if (L == R) {
    mn[p] = v;
    return;
  }
  int mid = L + R >> 1;
  if (x <= mid)
    Update(L, mid, p << 1, x, v);
  else
    Update(mid + 1, R, p << 1 | 1, x, v);
  mn[p] = min(mn[p << 1], mn[p << 1 | 1]);
}
int Query(int L, int R, int p, int l, int r) {
  if (L == l && R == r) return mn[p];
  int mid = L + R >> 1;
  if (r <= mid)
    return Query(L, mid, p << 1, l, r);
  else if (l > mid)
    return Query(mid + 1, R, p << 1 | 1, l, r);
  else
    return min(Query(L, mid, p << 1, l, mid),
               Query(mid + 1, R, p << 1 | 1, mid + 1, r));
}
int LCA_Query(int x, int y) {
  int res = 0x3f3f3f3f;
  while (Top[x] != Top[y]) {
    if (dep[Top[x]] < dep[Top[y]]) swap(x, y);
    chkmi(res, Query(1, bcc_id, 1, SgId[Top[x]], SgId[x]));
    x = Fa[Top[x]];
  }
  if (dep[x] < dep[y]) swap(x, y);
  chkmi(res, Query(1, bcc_id, 1, SgId[y], SgId[x]));
  if (y > n) chkmi(res, val[Fa[y]]);
  return res;
}
char op[5];
int main() {
  memset(Head, -1, sizeof(Head));
  scanf("%d%d%d", &n, &m, &q);
  for (int i = (1), _t = (n); i <= _t; ++i) scanf("%d", &val[i]);
  for (int i = (1), _t = (m); i <= _t; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    Edge(x, y);
    Edge(y, x);
  }
  bcc_id = n;
  Tarjan(1);
  dfs(1, 0);
  DFS(1, 1);
  for (int i = (1), _t = (n); i <= _t; ++i)
    for (int j = (0), _t = (G[i].size() - 1); j <= _t; ++j)
      if (Fa[i] == G[i][j]) Heap[G[i][j]].push(val[i]);
  for (int i = (1), _t = (n); i <= _t; ++i) num[SgId[i]] = val[i];
  for (int i = (n + 1), _t = (bcc_id); i <= _t; ++i)
    num[SgId[i]] = Heap[i].top();
  build(1, bcc_id, 1);
  for (int i = (1), _t = (q); i <= _t; ++i) {
    int x, y;
    scanf("%s%d%d", op, &x, &y);
    if (op[0] == 'C') {
      if (Fa[x]) Heap[Fa[x]].pop(val[x]);
      val[x] = y;
      if (Fa[x]) {
        Heap[Fa[x]].push(val[x]);
        Update(1, bcc_id, 1, SgId[Fa[x]], Heap[Fa[x]].top());
      }
      Update(1, bcc_id, 1, SgId[x], val[x]);
    } else
      printf("%d\n", LCA_Query(x, y));
  }
  return 0;
}
