#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int K = 400;
int n, m, q, x[N][12], y[N][12];
char s[N][12];
void dfs(int i, int j) {
  if (j < 1 || m < j) {
    x[i][j] = i, y[i][j] = j;
    return;
  }
  if (x[i][j] != N) return;
  if (s[i][j] == '^') {
    x[i][j] = x[i - 1][j], y[i][j] = y[i - 1][j];
    return;
  }
  if (s[i][j] == '>') {
    dfs(i, j + 1);
    x[i][j] = x[i][j + 1];
    y[i][j] = y[i][j + 1];
  } else {
    dfs(i, j - 1);
    x[i][j] = x[i][j - 1];
    y[i][j] = y[i][j - 1];
  }
}
void build(int L, int R) {
  for (int i = L; i < R; i++)
    for (int j = 1; j <= m; j++) x[i][j] = y[i][j] = N;
  for (int j = 1; j <= m; j++)
    if (s[L][j] == '^') x[L][j] = L - 1, y[L][j] = j;
  for (int i = L; i < R; i++)
    for (int j = 2; j <= m; j++) {
      if (s[i][j - 1] == '>' && s[i][j] == '<')
        x[i][j - 1] = y[i][j - 1] = -1, x[i][j] = y[i][j] = -1;
    }
  for (int i = L; i < R; i++)
    for (int j = 1; j <= m; j++)
      if (x[i][j] == N) dfs(i, j);
}
int main() {
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf(" %s", s[i]);
    s[i][m + 1] = '\0';
    for (int j = m; j > 0; j--) swap(s[i][j], s[i][j - 1]);
    s[i][0] = '#';
  }
  for (int L = 1; L <= n; L += K) {
    int R = min(n + 1, L + K);
    build(L, R);
  }
  while (q--) {
    char type;
    int sx, sy;
    scanf(" %c %d %d", &type, &sx, &sy);
    if (type == 'A') {
      for (;;) {
        if (sx == -1 && sy == -1) break;
        if (sx < 1 || sy < 1 || m < sy) break;
        int tx = x[sx][sy];
        int ty = y[sx][sy];
        sx = tx, sy = ty;
      }
      printf("%d %d\n", sx, sy);
    } else {
      scanf(" %c", &type);
      s[sx][sy] = type;
      int L = ((sx - 1) / K) * K + 1, R = min(L + K, n + 1);
      build(L, R);
    }
  }
}
