#include <bits/stdc++.h>
using namespace std;
const int maxn = 200001;
int head[maxn], col[maxn], kl, dfn[maxn], val[maxn], low[maxn];
int anss, a[maxn], stac[maxn], num, b[maxn], sz[maxn], cnt[maxn];
int indec, sqr, n, m, x, y, top, ans;
int fa[maxn], dep[maxn], son[maxn], back[maxn], tp[maxn], Q;
struct heapy {
  priority_queue<int> q1, q2;
  int sz;
  void add(int x) {
    q1.push(-x);
    ++sz;
  }
  void del(int x) {
    q2.push(-x);
    --sz;
  }
  int top() {
    while (!q2.empty() && q1.top() == q2.top()) q1.pop(), q2.pop();
    return -q1.top();
  }
  int pop() {
    while (!q2.empty() && q1.top() == q2.top()) q1.pop(), q2.pop();
    if (!q1.empty()) q1.pop();
    sz--;
  }
} hp[maxn];
struct line {
  int fr, to, next;
} q[maxn * 2];
vector<int> e[maxn];
void pushline(int f, int t) {
  q[++kl].next = head[f];
  head[f] = kl;
  q[kl].to = t;
}
void tarjan(int x, int fa) {
  ++num;
  stac[++top] = x;
  dfn[x] = low[x] = ++indec;
  for (int p = head[x]; int v = q[p].to; p = q[p].next) {
    if (!dfn[v]) {
      tarjan(v, x);
      low[x] = min(low[x], low[v]);
      if (low[v] == dfn[x]) {
        ++sqr;
        e[sqr].push_back(x);
        e[x].push_back(sqr);
        for (int now = 0; now != v; --top) {
          now = stac[top];
          e[sqr].push_back(now);
          e[now].push_back(sqr);
        }
      }
    } else
      low[x] = min(low[x], dfn[v]);
  }
}
struct seg {
  int l, r, val;
} t[maxn * 4];
void pushup(int x) { t[x].val = min(t[x << 1].val, t[x << 1 | 1].val); }
void build(int x, int l, int r) {
  t[x].l = l;
  t[x].r = r;
  if (l == r) {
    if (back[l] > n)
      t[x].val = hp[back[l]].top();
    else
      t[x].val = val[back[l]];
    return;
  }
  int mid = (l + r) / 2;
  build(x << 1, l, mid);
  build(x << 1 | 1, mid + 1, r);
  pushup(x);
}
void change(int x, int pos, int d) {
  if (t[x].l == t[x].r && pos == t[x].l) {
    t[x].val = d;
    return;
  }
  int mid = (t[x].l + t[x].r) / 2;
  if (pos <= mid) change(x << 1, pos, d);
  if (pos > mid) change(x << 1 | 1, pos, d);
  pushup(x);
}
int query(int x, int l, int r) {
  if (l > r) swap(l, r);
  int lx = t[x].l, rx = t[x].r;
  if (l <= lx && r >= rx) return t[x].val;
  int mid = (lx + rx) / 2, ans = 1e9;
  if (l <= mid) ans = query(x << 1, l, r);
  if (r > mid) ans = min(ans, query(x << 1 | 1, l, r));
  return ans;
}
void dfs1(int x, int fat) {
  fa[x] = fat, sz[x] = 1, dep[x] = dep[fat] + 1, son[x] = 0;
  if (x <= n && fa[x]) hp[fa[x]].add(val[x]);
  for (int v : e[x]) {
    if (v == fat) continue;
    dfs1(v, x);
    if (sz[v] > sz[son[x]]) son[x] = v;
    sz[x] += sz[v];
  }
}
void dfs2(int x, int topp) {
  tp[x] = topp;
  dfn[x] = ++indec;
  back[indec] = x;
  if (son[x]) dfs2(son[x], topp);
  for (int v : e[x]) {
    if (v == fa[x] || v == son[x]) continue;
    dfs2(v, v);
  }
}
int treequery(int x, int y) {
  int ans = 1e9;
  while (tp[x] != tp[y]) {
    if (dep[tp[x]] < dep[tp[y]]) swap(x, y);
    ans = min(ans, query(1, dfn[tp[x]], dfn[x]));
    x = fa[tp[x]];
  }
  if (dep[x] > dep[y]) swap(x, y);
  ans = min(ans, query(1, dfn[x], dfn[y]));
  if (fa[x] <= n && fa[x]) ans = min(ans, val[fa[x]]);
  return ans;
}
char opt[10];
int main() {
  cin >> n >> m >> Q;
  sqr = n;
  for (int i = 1; i <= n; i++) scanf("%d", &val[i]);
  for (int i = 1; i <= m; i++)
    scanf("%d%d", &x, &y), pushline(x, y), pushline(y, x);
  for (int i = 1; i <= n; i++)
    if (!dfn[i]) tarjan(i, 0);
  indec = 0;
  dfs1(1, 0);
  dfs2(1, 1);
  build(1, 1, sqr);
  while (Q--) {
    scanf("%s%d%d", opt, &x, &y);
    if (opt[0] == 'C') {
      change(1, dfn[x], y);
      int v = fa[x];
      if (v > n) {
        hp[v].del(val[x]);
        hp[v].add(y);
        change(1, dfn[v], hp[v].top());
      }
      val[x] = y;
    } else
      printf("%d\n", treequery(x, y));
  }
}
