#include <bits/stdc++.h>
using namespace std;
const int BN = 316;
int n, m, qx[100111][12], qy[100111][12], q;
char g[100011][12];
void update(int r1, int r2) {
  for (int i = r1; i <= r2; i++)
    for (int j = 1; j <= m; j++) qx[i][j] = qy[i][j] = -1;
  for (int i = 1; i <= m; i++)
    if (g[r1][i] == '^') qx[r1][i] = r1 - 1, qy[r1][i] = i;
  for (int i = r1; i <= r2; i++)
    qx[i][0] = i, qy[i][0] = 0, qx[i][m + 1] = i, qy[i][m + 1] = m + 1;
  for (int i = r1; i <= r2; i++) {
    for (int j = 1; j <= m; j++) {
      if (i != r1 && g[i][j] == '^')
        qx[i][j] = qx[i - 1][j], qy[i][j] = qy[i - 1][j];
      else if (g[i][j] == '<')
        qx[i][j] = qx[i][j - 1], qy[i][j] = qy[i][j - 1];
    }
    for (int j = m; j >= 1; j--) {
      if (g[i][j] == '>') qx[i][j] = qx[i][j + 1], qy[i][j] = qy[i][j + 1];
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= m; j++) g[i][j] = getchar();
  for (int i = 1; i <= n; i += BN) update(i, min(n, i + BN - 1));
  char op, op2;
  int x, y, t;
  while (q--) {
    getchar();
    op = getchar();
    scanf("%d%d", &x, &y);
    if (op == 'C') {
      getchar();
      op2 = getchar();
      g[x][y] = op2;
      update((x - 1) / BN * BN + 1, min(n, ((x - 1) / BN + 1) * BN));
    } else {
      while (x > 0 && y > 0 && y <= m) t = x, x = qx[x][y], y = qy[t][y];
      printf("%d %d\n", x, y);
    }
  }
  return 0;
}
