#include <bits/stdc++.h>
using namespace std;
int n, m;
const int N = 2e5 + 10;
const int M = 4e5 + 10;
int col[N];
struct bain {
  int from, to;
};
struct tree {
  bain eg[N << 1];
  int front[N], num;
  void add(int x, int y) {
    eg[++num].to = y;
    eg[num].from = front[x];
    front[x] = num;
  }
  int ids = 0;
  int siz[N], dfn[N], son[N], dep[N], top[N], fa[N];
  void dfs1(int o, int from) {
    fa[o] = from;
    dep[o] = dep[from] + 1;
    siz[o] = 1;
    for (int i = front[o]; i; i = eg[i].from) {
      int to = eg[i].to;
      if (to == from) continue;
      dfs1(to, o);
      siz[o] += siz[to];
      if (siz[to] > siz[son[o]]) son[o] = to;
    }
  }
  void dfs2(int o, int tp) {
    dfn[o] = ++ids;
    top[o] = tp;
    if (son[o]) dfs2(son[o], tp);
    for (int i = front[o]; i; i = eg[i].from) {
      int to = eg[i].to;
      if (to == fa[o] || to == son[o]) continue;
      dfs2(to, to);
    }
  }
  multiset<int> se[N];
  int mins[N << 2];
  void opt1(int o, int l, int r, int i, int x) {
    if (l == r) {
      mins[o] = x;
      return;
    }
    int mid = (l + r) >> 1;
    if (mid >= i)
      opt1(o << 1, l, mid, i, x);
    else
      opt1(o << 1 | 1, mid + 1, r, i, x);
    mins[o] = min(mins[o << 1], mins[o << 1 | 1]);
  }
  int opt2(int o, int l, int r, int L, int R) {
    if (L <= l && r <= R) return mins[o];
    int mid = (l + r) >> 1, a = 1e9;
    if (mid >= L) a = opt2(o << 1, l, mid, L, R);
    if (mid < R) a = min(opt2(o << 1 | 1, mid + 1, r, L, R), a);
    return a;
  }
  int que(int x, int y) {
    int re = 1e9;
    while (top[x] != top[y]) {
      if (dep[top[x]] < dep[top[y]]) swap(x, y);
      re = min(re, opt2(1, 1, n, dfn[top[x]], dfn[x]));
      x = fa[top[x]];
    }
    if (dep[x] < dep[y]) swap(x, y);
    re = min(re, opt2(1, 1, n, dfn[y], dfn[x]));
    if (col[y]) re = min(re, opt2(1, 1, n, dfn[fa[y]], dfn[fa[y]]));
    return re;
  }
} T;
struct graph {
  bain eg[M << 1];
  int front[N], num;
  void add(int x, int y) {
    eg[++num].to = y;
    eg[num].from = front[x];
    front[x] = num;
  }
  int ids = 0;
  int dfn[N], low[N];
  int st[N];
  int top;
  int tot = 0;
  int dfs(int o) {
    low[o] = dfn[o] = ++ids;
    st[++top] = o;
    for (int i = front[o]; i; i = eg[i].from) {
      int to = eg[i].to;
      if (dfn[to] == 0) {
        low[o] = min(low[o], dfs(to));
        if (dfn[o] <= low[to]) {
          ++n;
          col[n] = 1;
          int now;
          T.add(n, o);
          T.add(o, n);
          do {
            now = st[top--];
            T.add(n, now);
            T.add(now, n);
          } while (now != to);
        }
      } else
        low[o] = min(low[o], dfn[to]);
    }
    return low[o];
  }
} G;
int w[N], q;
int main() {
  scanf("%d%d%d", &n, &m, &q);
  G.tot = n;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &w[i]);
  }
  for (int i = 1; i <= m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    G.add(x, y);
    G.add(y, x);
  }
  G.dfs(1);
  T.dfs1(1, 0);
  T.dfs2(1, 1);
  for (int i = 1; i <= n; ++i) {
    if (col[i]) {
      for (int j = T.front[i]; j; j = T.eg[j].from) {
        int to = T.eg[j].to;
        if (to != T.fa[i]) T.se[i].insert(w[to]);
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (col[i])
      T.opt1(1, 1, n, T.dfn[i], *((T.se[i]).begin()));
    else
      T.opt1(1, 1, n, T.dfn[i], w[i]);
  }
  for (int i = 1; i <= q; ++i) {
    char ss[10];
    int x, y;
    scanf("%s%d%d", &ss, &x, &y);
    if (ss[0] == 'A') {
      printf("%d\n", T.que(x, y));
    } else {
      T.opt1(1, 1, n, T.dfn[x], y);
      if (x != 1) {
        T.se[T.fa[x]].erase(T.se[T.fa[x]].lower_bound(w[x]));
        w[x] = y;
        T.se[T.fa[x]].insert(y);
        T.opt1(1, 1, n, T.dfn[T.fa[x]], *T.se[T.fa[x]].begin());
      }
    }
  }
}
