#include <bits/stdc++.h>
using namespace std;
struct data {
  int x, y;
} t[800001];
int n, m, k, x, y, sum, cnt, tot, h[400001], st[400001], f[400001], fa[400001],
    p[400001], idfn[400001], dfn[400001], low[400001], son[400001], dep[400001],
    sz[400001], tr[1600001];
char ch[11];
vector<int> v[400001];
multiset<int> q[400001];
void add(int a, int b) {
  cnt++;
  t[cnt].x = b;
  t[cnt].y = h[a];
  h[a] = cnt;
}
void tarjan(int a) {
  cnt++;
  dfn[a] = cnt;
  low[a] = cnt;
  tot++;
  st[tot] = a;
  for (int i = h[a]; i; i = t[i].y) {
    if (!dfn[t[i].x]) {
      tarjan(t[i].x);
      low[a] = min(low[a], low[t[i].x]);
      if (low[t[i].x] >= dfn[a]) {
        sum++;
        v[sum].push_back(a);
        v[a].push_back(sum);
        int c;
        do {
          c = st[tot];
          tot--;
          v[sum].push_back(c);
          v[c].push_back(sum);
        } while (c != t[i].x);
      }
    } else {
      low[a] = min(low[a], dfn[t[i].x]);
    }
  }
}
void dfs1(int a) {
  sz[a] = 1;
  for (int i = h[a]; i; i = t[i].y) {
    if (t[i].x == fa[a]) continue;
    fa[t[i].x] = a;
    dep[t[i].x] = dep[a] + 1;
    dfs1(t[i].x);
    if (sz[son[a]] < sz[t[i].x]) son[a] = t[i].x;
    sz[a] = sz[a] + sz[t[i].x];
  }
}
void dfs2(int a, int c) {
  cnt++;
  dfn[a] = cnt;
  idfn[cnt] = a;
  p[a] = c;
  if (son[a]) dfs2(son[a], c);
  for (int i = h[a]; i; i = t[i].y) {
    if (t[i].x == fa[a]) continue;
    if (t[i].x == son[a]) continue;
    dfs2(t[i].x, t[i].x);
  }
}
void build(int a, int l, int r) {
  if (l == r) {
    tr[a] = f[idfn[l]];
    return;
  }
  int mid = (l + r) / 2;
  build(a * 2, l, mid);
  build(a * 2 + 1, mid + 1, r);
  tr[a] = min(tr[a * 2], tr[a * 2 + 1]);
}
void turn(int a, int l, int r, int u, int v) {
  if (l > u || r < u) return;
  if (l == r) {
    tr[a] = v;
    return;
  }
  int mid = (l + r) / 2;
  turn(a * 2, l, mid, u, v);
  turn(a * 2 + 1, mid + 1, r, u, v);
  tr[a] = min(tr[a * 2], tr[a * 2 + 1]);
}
int find(int a, int l, int r, int ql, int qr) {
  if (l > qr || r < ql) return 1000000000;
  if (ql <= l && r <= qr) return tr[a];
  int mid = (l + r) / 2;
  int p1 = find(a * 2, l, mid, ql, qr);
  int p2 = find(a * 2 + 1, mid + 1, r, ql, qr);
  return min(p1, p2);
}
int solve(int a, int b) {
  int s = 1000000000;
  while (p[a] != p[b]) {
    if (dep[p[a]] > dep[p[b]]) swap(a, b);
    s = min(s, find(1, 1, sum, dfn[p[b]], dfn[b]));
    b = fa[p[b]];
  }
  if (dep[a] > dep[b]) swap(a, b);
  s = min(s, find(1, 1, sum, dfn[a], dfn[b]));
  if (a > n) s = min(s, f[fa[a]]);
  return s;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &f[i]);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  cnt = 0;
  sum = n;
  tarjan(1);
  cnt = 0;
  for (int i = 1; i <= n; i++) h[i] = 0;
  for (int i = 1; i <= sum; i++) {
    for (int j = 0; j < v[i].size(); j++) {
      add(i, v[i][j]);
    }
  }
  cnt = 0;
  dfs1(1);
  dfs2(1, 1);
  for (int i = n + 1; i <= sum; i++) {
    for (int j = h[i]; j; j = t[j].y) {
      if (t[j].x == fa[i]) continue;
      q[i].insert(f[t[j].x]);
    }
    f[i] = *q[i].begin();
  }
  build(1, 1, sum);
  for (int i = 1; i <= k; i++) {
    scanf("%s%d%d", ch + 1, &x, &y);
    if (ch[1] == 'C') {
      if (fa[x] > n) {
        q[fa[x]].erase(q[fa[x]].find(f[x]));
        q[fa[x]].insert(y);
        turn(1, 1, sum, dfn[fa[x]], *q[fa[x]].begin());
      }
      f[x] = y;
      turn(1, 1, sum, dfn[x], y);
    } else {
      printf("%d\n", solve(x, y));
    }
  }
}
