#include <bits/stdc++.h>
using namespace std;
int const maxn = 1e5 + 10, N = 320;
int n, m, q;
char s[maxn][15];
int ini, fim;
pair<int, int> to[maxn][15];
bool mrk[maxn][15];
void dfs(int i, int j) {
  mrk[i][j] = 1;
  int x, y;
  if (s[i][j] == '^') x = i - 1, y = j;
  if (s[i][j] == '<') x = i, y = j - 1;
  if (s[i][j] == '>') x = i, y = j + 1;
  if (x <= 0 || y <= 0 || x > n || y > m) {
    to[i][j] = pair<int, int>(x, y);
    return;
  }
  if (x < ini || x > fim) {
    to[i][j] = pair<int, int>(x, y);
    return;
  }
  if (!mrk[x][y]) dfs(x, y);
  to[i][j] = to[x][y];
}
pair<int, int> query(int x, int y) {
  if (x == -1 || y == -1) return pair<int, int>(-1, -1);
  if (x <= 0 || y <= 0 || x > n || y > m) return pair<int, int>(x, y);
  return query(to[x][y].first, to[x][y].second);
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q;
  for (int i = 1; i <= (int)n; i++)
    for (int j = 1; j <= (int)m; j++)
      cin >> s[i][j], to[i][j] = pair<int, int>(-1, -1);
  for (int i = 1; i <= (int)n; i++)
    for (int j = 1; j <= (int)m; j++) {
      int block = (i - 1) / N;
      ini = block * N + 1, fim = min(n, ini + N - 1);
      if (!mrk[i][j]) dfs(i, j);
    }
  while (q--) {
    char type, c;
    int x, y;
    cin >> type >> x >> y;
    if (type == 'A') {
      pair<int, int> ans = query(x, y);
      cout << ans.first << " " << ans.second << '\n';
    }
    if (type == 'C') {
      cin >> c;
      s[x][y] = c;
      int block = (x - 1) / N;
      ini = block * N + 1, fim = min(n, ini + N - 1);
      for (int i = (int)ini; i <= (int)fim; i++)
        for (int j = 1; j <= (int)m; j++)
          mrk[i][j] = 0, to[i][j] = pair<int, int>(-1, -1);
      for (int i = (int)ini; i <= (int)fim; i++)
        for (int j = 1; j <= (int)m; j++)
          if (!mrk[i][j]) dfs(i, j);
    }
  }
}
