#include <bits/stdc++.h>
using namespace std;
const int bsize = 301;
int n, m, q;
char a[120005][15];
struct Bucket {
  int id;
  unsigned char v[bsize + 5][15];
  pair<int, int> exit[15];
  bool inside(int r, int c) { return r >= 0 && r < bsize && c >= 0 && c < m; }
  pair<int, int> getExit(int r, int c, int i = 0, bool clear = true) {
    if (clear) memset(v, -1, sizeof(v));
    while (inside(r, c)) {
      if (int(v[r][c]) == i) break;
      v[r][c] = (unsigned char)i;
      const char& sign = a[r + bsize * id][c];
      if (sign == '<')
        c--;
      else if (sign == '>')
        c++;
      else if (sign == '^')
        r--;
      else
        break;
    }
    if (r < 0)
      return make_pair(0, c);
    else if (c < 0)
      return make_pair(1, r);
    else if (c >= m)
      return make_pair(2, r);
    return make_pair(3, 0);
    ;
  }
  void update() {
    memset(v, -1, sizeof(v));
    for (int i = 0; i < m; i++) exit[i] = getExit(bsize - 1, i, i, false);
  }
} bucket[120000 / bsize + 5];
int main() {
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 0; i < n; i++) scanf("%s", a[i]);
  for (int i = 0; i <= n / bsize; i++) {
    bucket[i].id = i;
    bucket[i].update();
  }
  while (q--) {
    int r, c;
    char op[5];
    scanf("%s", op);
    if (op[0] == 'A') {
      scanf("%d %d", &r, &c);
      r--, c--;
      pair<int, int> exit = bucket[r / bsize].getExit(r % bsize, c);
      r /= bsize;
      r--;
      while (exit.first == 0 && r >= 0) exit = bucket[r--].exit[exit.second];
      r++;
      if (exit.first == 0)
        printf("%d %d\n", 0, exit.second + 1);
      else if (exit.first == 1)
        printf("%d %d\n", exit.second + 1 + r * bsize, 0);
      else if (exit.first == 2)
        printf("%d %d\n", exit.second + 1 + r * bsize, m + 1);
      else
        printf("%d %d\n", -1, -1);
    } else {
      scanf("%d %d %s", &r, &c, op);
      a[r - 1][c - 1] = op[0];
      bucket[r / bsize].update();
    }
  }
  return 0;
}
