#include <bits/stdc++.h>
const int Max = 1e5 + 10;
using namespace std;
struct edge {
  int to;
  int next;
};
struct heap {
  priority_queue<int, vector<int>, greater<int> > add, del;
  int getMin() {
    while (!add.empty() && !del.empty() && add.top() == del.top()) {
      add.pop();
      del.pop();
    }
    return add.top();
  }
  void insert(int x) { add.push(x); }
  void remove(int x) {
    if (add.top() == x) {
      add.pop();
    } else {
      del.push(x);
    }
  }
  bool empty() { return add.size() - del.size() > 0; }
} point[Max << 1];
vector<int> e[Max], g[Max << 1];
int tree[Max << 3], val[Max << 1];
int head[Max], head1[Max << 1], dfn[Max << 1], rDfn[Max << 1], low[Max << 1],
    son[Max << 1], hTop[Max << 1], size[Max << 1], fa[Max << 1], dep[Max << 1];
int s[Max];
int cnt = 0, cnt1 = 0, timing = 0, top = -1, all;
int n, m, q;
void dfs(int u) {
  son[u] = 0;
  size[u] = 1;
  for (int v : g[u]) {
    if (!dep[v]) {
      dep[v] = dep[u] + 1;
      fa[v] = u;
      dfs(v);
      size[u] += size[v];
      if (size[v] > size[son[u]]) {
        son[u] = v;
      }
    }
  }
}
void linkCut(int u, int top) {
  hTop[u] = top;
  dfn[u] = ++timing;
  rDfn[timing] = u;
  if (!son[u]) {
    return;
  }
  linkCut(son[u], top);
  for (int v : g[u]) {
    if (v != son[u] && v != fa[u]) {
      linkCut(v, v);
    }
  }
}
void tarjan(int u) {
  dfn[u] = low[u] = ++timing;
  s[++top] = u;
  for (int v : e[u]) {
    if (!dfn[v]) {
      tarjan(v);
      low[u] = min(low[u], low[v]);
      if (dfn[u] == low[v]) {
        ++all;
        for (int t = 0; t != v; top--) {
          t = s[top];
          g[all].push_back(t);
          g[t].push_back(all);
        }
        g[all].push_back(u);
        g[u].push_back(all);
      }
    } else {
      low[u] = min(low[u], dfn[v]);
    }
  }
}
void pushUp(int k) { tree[k] = min(tree[k << 1], tree[k << 1 | 1]); }
void build(int i, int l, int r) {
  if (l == r) {
    tree[i] = val[rDfn[l]];
    return;
  }
  build((i << 1), l, ((l + r) >> 1)),
      build((i << 1 | 1), ((l + r) >> 1) + 1, r);
  tree[i] = std::min(tree[(i << 1)], tree[(i << 1 | 1)]);
}
void update(int i, int l, int r, int p, int x) {
  if (l == r) {
    tree[i] = x;
    return;
  }
  if (p <= ((l + r) >> 1))
    update((i << 1), l, ((l + r) >> 1), p, x);
  else
    update((i << 1 | 1), ((l + r) >> 1) + 1, r, p, x);
  tree[i] = std::min(tree[(i << 1)], tree[(i << 1 | 1)]);
}
int query(int i, int l, int r, int a, int b) {
  if (r < a || b < l) return 0x7fffffff;
  if (a <= l && r <= b) return tree[i];
  return std::min(query((i << 1), l, ((l + r) >> 1), a, b),
                  query((i << 1 | 1), ((l + r) >> 1) + 1, r, a, b));
}
void modify(int u, int x) {
  int mn;
  update(1, 1, all, dfn[u], x);
  if (fa[u]) {
    point[fa[u]].remove(val[u]);
    point[fa[u]].insert(x);
    mn = point[fa[u]].getMin();
    if (val[fa[u]] != mn) {
      val[fa[u]] = mn;
      update(1, 1, all, dfn[fa[u]], val[fa[u]]);
    }
  }
  val[u] = x;
}
int solve(int u, int v) {
  int ans = 0x7fffffff;
  while (hTop[u] != hTop[v]) {
    if (dep[hTop[u]] < dep[hTop[v]]) {
      swap(u, v);
    }
    ans = min(ans, query(1, 1, all, dfn[hTop[u]], dfn[u]));
    u = fa[hTop[u]];
  }
  if (dep[u] > dep[v]) {
    swap(u, v);
  }
  ans = min(ans, query(1, 1, all, dfn[u], dfn[v]));
  if (u > n) {
    ans = min(ans, val[fa[u]]);
  }
  return ans;
}
int main() {
  int u, v, k, x, y;
  char op[2];
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &val[i]);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  all = n;
  for (int i = 1; i <= n; i++) {
    if (!dfn[i]) {
      tarjan(i);
      top = -1;
    }
  }
  timing = 0;
  dep[1] = 1;
  dfs(1);
  linkCut(1, 1);
  for (int i = 1; i <= n; i++) {
    if (fa[i]) {
      point[fa[i]].insert(val[i]);
    }
  }
  for (int i = n + 1; i <= all; i++) {
    val[i] = point[i].getMin();
  }
  build(1, 1, all);
  for (int i = 1; i <= q; i++) {
    scanf("%s", op);
    if (op[0] == 'C') {
      scanf("%d%d", &u, &k);
      modify(u, k);
    } else {
      scanf("%d%d", &u, &v);
      printf("%d\n", solve(u, v));
    }
  }
  return 0;
}
