#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n, m, q, vis[11];
char s[maxn][11];
struct node {
  int tx[11], ty[11];
  void init(int pos) {
    for (int i = 1; i <= m; i++) tx[i] = ty[i] = -1;
    for (int i = 1; i <= m; i++) {
      memset(vis, 0, sizeof(vis));
      int u = i;
      while (1) {
        if (vis[u]) {
          tx[i] = ty[i] = -1;
          break;
        }
        vis[u] = 1;
        bool flag = false;
        if (s[pos][u] == '<')
          u--;
        else if (s[pos][u] == '>')
          u++;
        else
          flag = true;
        if (flag) {
          tx[i] = pos - 1;
          ty[i] = u;
          break;
        }
        if (u < 1 || u > m) {
          tx[i] = pos;
          ty[i] = u;
          break;
        }
      }
    }
  }
} e[maxn << 2];
node operator+(node a, node b) {
  node c;
  for (int i = 1; i <= m; i++) {
    if (b.ty[i] == -1 || b.tx[i] == -1) c.tx[i] = c.ty[i] = -1;
    if (b.ty[i] < 1 || b.ty[i] > m) {
      c.tx[i] = b.tx[i];
      c.ty[i] = b.ty[i];
    } else {
      c.tx[i] = a.tx[b.ty[i]];
      c.ty[i] = a.ty[b.ty[i]];
    }
  }
  return c;
}
void build(int o, int l, int r) {
  if (l == r) {
    e[o].init(l);
    return;
  }
  int mid = (l + r) >> 1;
  build(o * 2, l, mid);
  build(o * 2 + 1, mid + 1, r);
  e[o] = e[o * 2] + e[o * 2 + 1];
}
void update(int o, int l, int r, int pos, int y, char v) {
  if (l == r) {
    s[pos][y] = v;
    e[o].init(l);
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    update(o * 2, l, mid, pos, y, v);
  else
    update(o * 2 + 1, mid + 1, r, pos, y, v);
  e[o] = e[o * 2] + e[o * 2 + 1];
}
node query(int o, int l, int r, int x, int y) {
  if (x <= l && r <= y) return e[o];
  int mid = (l + r) >> 1;
  if (y <= mid)
    return query(o * 2, l, mid, x, y);
  else if (x > mid)
    return query(o * 2 + 1, mid + 1, r, x, y);
  else
    return query(o * 2, l, mid, x, mid) +
           query(o * 2 + 1, mid + 1, r, mid + 1, y);
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  build(1, 1, n);
  while (q--) {
    char ch[10], ss[10];
    scanf("%s", ch);
    if (ch[0] == 'A') {
      int x, y;
      scanf("%d%d", &x, &y);
      node temp = query(1, 1, n, 1, x);
      printf("%d %d\n", temp.tx[y], temp.ty[y]);
    } else {
      int x, y;
      scanf("%d%d", &x, &y);
      scanf("%s", ss);
      update(1, 1, n, x, y, ss[0]);
    }
  }
  return 0;
}
