#include <bits/stdc++.h>
using namespace std;
int n, m, q;
int blk, bl[100005];
char str[100005][12];
int L[100005], R[100005];
pair<int, int> to[100005][12];
pair<int, int> dfs(int x, int y, int board) {
  if (to[x][y].first != -2) return to[x][y];
  pair<int, int> &ans = to[x][y];
  if (str[x][y] == '^') {
    if (x - 1 == board)
      ans = {board, y};
    else
      ans = dfs(x - 1, y, board);
    return ans;
  }
  if (str[x][y] == '<') {
    if (y == 1)
      ans = {x, 0};
    else if (str[x][y - 1] == '>')
      ans = {-1, -1};
    else
      ans = dfs(x, y - 1, board);
  } else {
    if (y == m)
      ans = {x, m + 1};
    else if (str[x][y + 1] == '<')
      ans = {-1, -1};
    else
      ans = dfs(x, y + 1, board);
  }
  return ans;
}
void build(int x) {
  int l = L[x], r = R[x];
  for (int i = l; i <= r; ++i)
    for (int j = 1; j <= m; ++j) to[i][j] = {-2, -2};
  for (int i = l; i <= r; ++i)
    for (int j = 1; j <= m; ++j) dfs(i, j, l - 1);
}
int main() {
  scanf("%d %d %d\n", &n, &m, &q);
  for (int i = 1; i <= n; ++i) scanf("%s\n", str[i] + 1);
  blk = (int)sqrt(n);
  for (int i = 1; i <= n; ++i) bl[i] = (i - 1) / blk + 1;
  for (int i = 1; i <= bl[n]; ++i) {
    L[i] = (i - 1) * blk + 1;
    R[i] = i * blk;
    if (R[i] >= n) {
      R[i] = n;
      break;
    }
  }
  for (int i = 1; i <= bl[n]; ++i) build(i);
  while (q--) {
    char op;
    int x, y;
    scanf("%c %d %d", &op, &x, &y);
    if (op == 'A') {
      while (x > 0 && y > 0 && y <= m) {
        int nx = to[x][y].first;
        int ny = to[x][y].second;
        x = nx, y = ny;
      }
      printf("%d %d\n", x, y);
    } else {
      char ch;
      scanf(" %c", &ch);
      str[x][y] = ch;
      build(bl[x]);
    }
    scanf("\n");
  }
  return 0;
}
