#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100, M = 10 + 10, SQ = 333;
pair<int, int> nxt[N][M];
char a[N][M];
bool mark[N][M];
int n, m, q;
bool OK(pair<int, int> x) {
  return x.first > 0 && x.second > 0 && x.second <= m;
}
pair<int, int> go(int x, int y) {
  if (!OK({x, y})) return {x, y};
  if (nxt[x][y].first != -2) return nxt[x][y];
  if (a[x][y] == '^')
    return x % SQ ? nxt[x][y] = go(x - 1, y) : nxt[x][y] = {x - 1, y};
  if (mark[x][y]) return nxt[x][y] = {-1, -1};
  mark[x][y] = true;
  if (a[x][y] == '>') nxt[x][y] = go(x, y + 1);
  if (a[x][y] == '<') nxt[x][y] = go(x, y - 1);
  mark[x][y] = false;
  return nxt[x][y];
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  for (int i = 0; i < N; i++)
    for (int j = 0; j < M; j++) nxt[i][j] = {-2, -2};
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) go(i, j);
  while (q--) {
    char tp;
    int x, y;
    cin >> tp >> x >> y;
    if (tp == 'A') {
      pair<int, int> tmp = {x, y};
      while (OK(tmp)) tmp = nxt[tmp.first][tmp.second];
      cout << tmp.first << " " << tmp.second << '\n';
    } else {
      cin >> a[x][y];
      int A = 0;
      while (A <= x) A += SQ;
      for (int i = x; i <= min(A, n); i++)
        for (int j = 1; j <= m; j++) nxt[i][j] = {-2, -2};
      for (int i = x; i <= min(A, n); i++)
        for (int j = 1; j <= m; j++) go(i, j);
    }
  }
}
