#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int M = 12;
int n, m, pw2, Q, t[N * 4][M];
char a[N][M];
void init(int i) {
  for (int j = 1; j <= m; j++) {
    int p = j, k;
    for (k = 0; k < m + 5; k++) {
      if (a[i][p] == '^') break;
      if (a[i][p] == '<')
        p--;
      else
        p++;
      if (a[i][p] == '~') break;
    }
    if (k == m + 5)
      t[i + pw2 - 1][j] = m + 1;
    else if (a[i][p] == '~')
      t[i + pw2 - 1][j] = ((!p) ? 100000 : 200000) + i;
    else
      t[i + pw2 - 1][j] = p;
  }
  t[i + pw2 - 1][m + 1] = m + 1;
}
void update(int i) {
  for (int j = 1; j <= m; j++) {
    int k = i * 2 + 1, x;
    x = t[k][j];
    if (x <= m + 1) {
      t[i][j] = t[i * 2][x];
    } else {
      t[i][j] = x;
    }
  }
}
int query(int x, int y, int i, int l, int r) {
  if (x >= r) {
    return t[i][y];
  }
  int mid = (l + r) >> 1;
  if (x > mid) y = query(x, y, i * 2 + 1, mid, r);
  if (y > m + 1) return y;
  return query(x, y, i * 2, l, mid);
}
int main() {
  scanf("%d%d%d", &n, &m, &Q);
  getchar();
  for (int i = 1; i <= n; i++) {
    scanf("%s", &a[i][1]);
    getchar();
    a[i][0] = '~';
    a[i][m + 1] = '~';
    a[i][m + 2] = '\0';
  }
  for (int i = 1; i <= m; i++) a[0][i] = a[n + 1][i] = '~';
  for (pw2 = 1; pw2 < n; pw2 <<= 1)
    ;
  for (int i = 0; i < pw2 * 2; i++) {
    for (int j = 1; j <= m + 1; j++) {
      t[i][j] = j;
    }
  }
  for (int i = 1; i <= n; i++) init(i);
  for (int i = pw2 - 1; i > 0; i--) update(i);
  while (Q--) {
    char type;
    int x, y;
    scanf("%c %d %d", &type, &x, &y);
    getchar();
    if (type == 'A') {
      int ans = query(x, y, 1, 1, pw2);
      if (ans > 0 && ans <= m) {
        printf("0 %d\n", ans);
      } else if (ans == m + 1) {
        printf("-1 -1\n");
      } else if (ans > 100000 && ans < 200000) {
        printf("%d 0\n", ans - 100000);
      } else {
        printf("%d %d\n", ans - 200000, m + 1);
      }
    } else {
      char ch;
      ch = getchar();
      getchar();
      a[x][y] = ch;
      init(x);
      for (int i = (pw2 + x - 1) / 2; i > 0; i >>= 1) {
        update(i);
      }
    }
  }
  return 0;
}
