#include <bits/stdc++.h>
using namespace std;
const int N = 110000;
const int T = 300;
char ch[N][13];
int n, m, numq, num_block, Left[1000], Right[1000], tag[N][13], which[N];
pair<int, int> ans[N][13];
pair<int, int> work(int x, int y, int l, int r) {
  if (!(x >= l && x <= r && y >= 1 && y <= m)) return make_pair(x, y);
  if (tag[x][y]) {
    tag[x][y] = 0;
    int xx = x, yy = y;
    if (ch[x][y] == '>') yy++;
    if (ch[x][y] == '<') yy--;
    if (ch[x][y] == '^') xx--;
    ans[x][y] = work(xx, yy, l, r);
  }
  return ans[x][y];
}
void calc(int t) {
  int l = Left[t], r = Right[t];
  for (int i = l; i <= r; i++)
    for (int j = 1; j <= m; j++) {
      tag[i][j] = 1;
      if (j < m && ch[i][j] == '>' && ch[i][j + 1] == '<') {
        tag[i][j] = 0;
        tag[i][j + 1] = 0;
        ans[i][j] = make_pair(-1, -1);
        ans[i][j + 1] = make_pair(-1, -1);
      }
    }
  for (int i = l; i <= r; i++)
    for (int j = 1; j <= m; j++) ans[i][j] = work(i, j, l, r);
}
int main() {
  cin >> n >> m >> numq;
  for (int i = 1; i <= n; i++) cin >> ch[i] + 1;
  num_block = n / T;
  if (n % T != 0) num_block++;
  for (int i = 1; i <= num_block; i++) {
    Left[i] = T * (i - 1) + 1;
    Right[i] = min(n, T * i);
    calc(i);
    for (int j = Left[i]; j <= Right[i]; j++) which[j] = i;
  }
  while (numq--) {
    char type[3];
    int x, y;
    scanf("%s%d%d", type, &x, &y);
    if (type[0] == 'A') {
      while (true) {
        if (!(x >= 1 && x <= n && y >= 1 && y <= m)) break;
        int xx = ans[x][y].first;
        int yy = ans[x][y].second;
        x = xx;
        y = yy;
      }
      printf("%d %d\n", x, y);
    } else {
      char c[3];
      scanf("%s", c);
      ch[x][y] = c[0];
      calc(which[x]);
    }
  }
}
