#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5, INF = 2e9 + 7;
int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
int n, m;
vector<int> e1[N], e[N];
int dfn[N], low[N], lead, stk[N], tp, ext, dep[N], top[N], seg[N], rev[N],
    sze[N], fa[N], son[N], val[N];
void link(int u, int v) {
  e[u].push_back(v);
  e[v].push_back(u);
}
int min(int x, int y) { return x < y ? x : y; }
void swap(int &x, int &y) {
  int t = x;
  x = y;
  y = t;
}
struct Heap {
  priority_queue<int> Del, q;
  void push(int x) { q.push(-x); }
  void del(int x) { Del.push(-x); }
  int top() {
    while (!q.empty() && !Del.empty() && q.top() == Del.top())
      q.pop(), Del.pop();
    return -q.top();
  }
} H[N];
void dfs(int u, int fa) {
  dfn[u] = low[u] = ++lead;
  stk[++tp] = u;
  for (int i = e1[u].size() - 1; i >= 0; --i) {
    int v = e1[u][i];
    if (!dfn[v]) {
      dfs(v, u);
      low[u] = min(low[v], low[u]);
      if (low[v] == dfn[u]) {
        val[++ext] = INF;
        int y = 0;
        while (y != v) {
          y = stk[tp--];
          link(ext, y);
        }
        link(ext, u);
      }
    } else
      low[u] = min(low[u], dfn[v]);
  }
}
void df5(int u, int fat) {
  sze[u] = 1;
  dep[u] = dep[fat] + 1;
  fa[u] = fat;
  val[fat] = min(val[fat], val[u]);
  H[fat].push(val[u]);
  for (int i = e[u].size() - 1; i >= 0; --i) {
    int v = e[u][i];
    if (v == fat) continue;
    df5(v, u);
    sze[u] += sze[v];
    if (sze[v] > sze[son[u]]) son[u] = v;
  }
}
void dfS(int u) {
  if (son[u]) {
    int v = son[u];
    seg[v] = ++lead;
    rev[lead] = v;
    top[v] = top[u];
    dfS(v);
  }
  for (int i = e[u].size() - 1; i >= 0; --i) {
    int v = e[u][i];
    if (!top[v]) {
      top[v] = v;
      seg[v] = ++lead;
      rev[lead] = v;
      dfS(v);
    }
  }
}
int mn[N << 2];
void pushup(int i) { mn[i] = min(mn[(i << 1)], mn[(i << 1 | 1)]); }
void build(int i, int l, int r) {
  if (l == r) {
    mn[i] = val[rev[l]];
    return;
  }
  build((i << 1), l, ((l + r) >> 1));
  build((i << 1 | 1), ((l + r) >> 1) + 1, r);
  pushup(i);
}
void updata(int i, int l, int r, int pos, int k) {
  if (l == r) {
    mn[i] = k;
    return;
  }
  if (pos <= ((l + r) >> 1))
    updata((i << 1), l, ((l + r) >> 1), pos, k);
  else
    updata((i << 1 | 1), ((l + r) >> 1) + 1, r, pos, k);
  pushup(i);
}
int query(int i, int l, int r, int x, int y) {
  if (x <= l && r <= y) return mn[i];
  int res = INF;
  if (x <= ((l + r) >> 1))
    res = min(res, query((i << 1), l, ((l + r) >> 1), x, y));
  if (y > ((l + r) >> 1))
    res = min(res, query((i << 1 | 1), ((l + r) >> 1) + 1, r, x, y));
  return res;
}
int ask(int x, int y) {
  int fx = top[x], fy = top[y];
  int res = INF;
  while (fx != fy) {
    if (dep[fx] < dep[fy]) swap(fx, fy), swap(x, y);
    res = min(res, query(1, 1, ext, seg[fx], seg[x]));
    x = fa[fx];
    fx = top[x];
  }
  if (dep[x] < dep[y]) swap(x, y);
  res = min(res, query(1, 1, ext, seg[y], seg[x]));
  if (y > n) res = min(res, val[fa[y]]);
  return res;
}
int Q;
int main() {
  n = read();
  m = read();
  Q = read();
  ext = n;
  for (int i = 1; i <= n; ++i) val[i] = read();
  for (int i = 1; i <= m; ++i) {
    int u = read(), v = read();
    e1[u].push_back(v);
    e1[v].push_back(u);
  }
  lead = 0;
  dfs(1, 0);
  df5(1, 0);
  rev[1] = seg[1] = top[1] = lead = 1;
  dfS(1);
  build(1, 1, ext);
  char opt[4];
  int a, b;
  while (Q--) {
    scanf("%s", opt);
    a = read();
    b = read();
    if (opt[0] == 'C') {
      H[fa[a]].del(val[a]);
      val[a] = b;
      updata(1, 1, ext, seg[a], b);
      H[fa[a]].push(val[a]);
      if (H[fa[a]].top() != val[fa[a]]) {
        val[fa[a]] = H[fa[a]].top();
        updata(1, 1, ext, seg[fa[a]], val[fa[a]]);
      }
    } else
      printf("%d\n", ask(a, b));
  }
  return 0;
}
