#include <bits/stdc++.h>
using namespace std;
struct SEG {
  pair<int, int> ans[12];
  SEG() {
    for (int i = 1; i <= 10; ++i) ans[i] = make_pair(-1, -1);
  }
} tree[100000 * 6 + 5];
char table[100000 + 5][11];
int M;
void build_row(int i, int x) {
  tree[i].ans[0] = make_pair(x, 0);
  tree[i].ans[M + 1] = make_pair(x, M + 1);
  for (int j = 1; j <= M; ++j) {
    tree[i].ans[j] = make_pair(-1, -1);
  }
  for (int j = 1; j <= M; ++j) {
    if (table[x][j] == '^') tree[i].ans[j] = make_pair(x - 1, j);
  }
  for (int j = M; j >= 1; --j) {
    if (table[x][j] == '>') tree[i].ans[j] = tree[i].ans[j + 1];
  }
  for (int j = 1; j <= M; ++j) {
    if (table[x][j] == '<') tree[i].ans[j] = tree[i].ans[j - 1];
  }
}
SEG merge_tree(SEG L, SEG R) {
  SEG P;
  for (int i = 1; i <= M; ++i) {
    if (R.ans[i].second <= 0 or R.ans[i].second > M)
      P.ans[i] = R.ans[i];
    else
      P.ans[i] = L.ans[R.ans[i].second];
  }
  return P;
}
void build(int i, int si, int sj) {
  if (si == sj)
    build_row(i, si);
  else {
    int mid = (si + sj) / 2;
    build(2 * i, si, mid);
    build(2 * i + 1, mid + 1, sj);
    tree[i] = merge_tree(tree[2 * i], tree[2 * i + 1]);
  }
}
void update(int i, int si, int sj, int Q) {
  if (si == sj)
    build_row(i, si);
  else {
    int mid = (si + sj) / 2;
    if (Q <= mid)
      update(2 * i, si, mid, Q);
    else
      update(2 * i + 1, mid + 1, sj, Q);
    tree[i] = merge_tree(tree[2 * i], tree[2 * i + 1]);
  }
}
SEG query(int i, int si, int sj, int Q) {
  if (si == sj)
    return tree[i];
  else {
    int mid = (si + sj) / 2;
    if (Q <= mid)
      return query(2 * i, si, mid, Q);
    else
      return merge_tree(tree[2 * i], query(2 * i + 1, mid + 1, sj, Q));
  }
}
int main() {
  int N, Q, x, y;
  char C;
  cin >> N >> M >> Q;
  for (int i = 1; i <= N; ++i) {
    for (int j = 1; j <= M; ++j) {
      scanf(" %c", &table[i][j]);
    }
  }
  build(1, 1, N);
  pair<int, int> ans;
  while (Q--) {
    scanf(" %c", &C);
    switch (C) {
      case 'A':
        scanf("%d", &x);
        scanf("%d", &y);
        ans = query(1, 1, N, x).ans[y];
        printf("%d %d\n", ans.first, ans.second);
        break;
      case 'C':
        scanf("%d", &x);
        scanf("%d", &y);
        scanf(" %c", &table[x][y]);
        update(1, 1, N, x);
    }
  }
}
