#include <bits/stdc++.h>
using namespace std;
int readint() {
  char c;
  while (c = getchar(), (c < '0' || c > '9') && c != '-')
    ;
  bool flag = (c == '-');
  if (flag) c = getchar();
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return flag ? -x : x;
}
char readchar() {
  char c;
  while (c = getchar(),
         c != 'A' && c != 'C' && c != '<' && c != '>' && c != '^')
    ;
  return c;
}
const int maxn = 100005;
const int maxm = 15;
const int block = 300;
int n, m, q, x, y;
pair<int, int> pos;
char t[maxn][maxm];
pair<int, int> nxt[maxn][maxm], go[maxn][maxm];
inline bool on(pair<int, int> pos) {
  return pos.first >= 1 && pos.first <= n && pos.second >= 1 && pos.second <= m;
}
void calc(int x, int y) {
  if (!on(make_pair(x, y))) {
    nxt[x][y] = make_pair(x, y);
    return;
  }
  if (nxt[x][y].first != -2) return;
  if (t[x][y] == '<') {
    if (t[x][y - 1] == '>')
      nxt[x][y] = make_pair(-1, -1);
    else
      calc(x, y - 1), nxt[x][y] = nxt[x][y - 1];
  } else if (t[x][y] == '>') {
    if (t[x][y + 1] == '<')
      nxt[x][y] = make_pair(-1, -1);
    else
      calc(x, y + 1), nxt[x][y] = nxt[x][y + 1];
  } else
    nxt[x][y] = make_pair(x - 1, y);
}
void jump(int start, int finish) {
  for (int i = start; i <= finish && i <= n; i++) {
    if (i % block == 1) {
      for (int j = 1; j <= m; j++) go[i][j] = nxt[i][j];
    } else {
      for (int j = 1; j <= m; j++) {
        if (!on(nxt[i][j]))
          go[i][j] = nxt[i][j];
        else
          go[i][j] = go[nxt[i][j].first][nxt[i][j].second];
      }
    }
  }
}
int main() {
  n = readint();
  m = readint();
  q = readint();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      t[i][j] = readchar(), nxt[i][j] = make_pair(-2, -2);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) calc(i, j);
  jump(1, n);
  while (q--) {
    char type = readchar();
    if (type == 'A') {
      pos.first = readint();
      pos.second = readint();
      while (on(pos)) {
        pos = go[pos.first][pos.second];
      }
      printf("%d %d\n", pos.first, pos.second);
    } else {
      x = readint();
      y = readint();
      char op = readchar();
      t[x][y] = op;
      for (int j = 1; j <= m; j++) nxt[x][j] = make_pair(-2, -2);
      for (int j = 1; j <= m; j++) calc(x, j);
      jump(x, x);
      jump(x + 1, (x / block + (x % block == 0 ? 0 : 1)) * block);
    }
  }
  return 0;
}
