#include <bits/stdc++.h>
using namespace std;
const int M = 350;
const int MAX = M * M;
int n, m, q;
int to[MAX][15][2];
char belt[MAX][15];
int a, b;
pair<int, int> dfs(int x, int y, int c, int d) {
  if (c < a || c > b || d < 1 || d > m) return pair<int, int>(c, d);
  if (to[c][d][0] != -2) return pair<int, int>(to[c][d][0], to[c][d][1]);
  int c1 = c;
  int d1 = d;
  if (belt[c][d] == '^')
    --c1;
  else if (belt[c][d] == '>')
    ++d1;
  else
    --d1;
  if (c1 == x && d1 == y) return pair<int, int>(-1, -1);
  pair<int, int> t = dfs(c, d, c1, d1);
  to[c][d][0] = t.first;
  to[c][d][1] = t.second;
  return t;
}
void update(int a, int b) {
  for (int i = b; i >= a; --i)
    for (int j = 1; j <= m; ++j) {
      to[i][j][0] = to[i][j][1] = -2;
    }
  for (int i = b; i >= a; --i)
    for (int j = 1; j <= m; ++j) {
      pair<int, int> t = dfs(-1, -1, i, j);
      to[i][j][0] = t.first;
      to[i][j][1] = t.second;
    }
}
void find(int a, int b) {
  for (int i = 0;; ++i) {
    if (a == -1) break;
    if (to[a][b][0] == a && to[a][b][1] == b) break;
    int a1 = to[a][b][0];
    int b1 = to[a][b][1];
    a = a1;
    b = b1;
  }
  printf("%d %d\n", a, b);
}
int main() {
  cin >> n >> m >> q;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) cin >> belt[i][j];
  for (int i = 1; i <= n; ++i) {
    to[i][0][0] = i;
    to[i][0][1] = 0;
    to[i][m + 1][0] = i;
    to[i][m + 1][1] = m + 1;
  }
  for (int i = 1; i <= m; ++i) {
    to[0][i][0] = 0;
    to[0][i][1] = i;
  }
  for (int i = 1; i <= n; i += M) {
    a = i;
    b = i + M - 1;
    b = min(n, b);
    update(a, b);
  }
  for (int i = 0; i < q; ++i) {
    char x;
    cin >> x;
    if (x == 'A') {
      cin >> a >> b;
      find(a, b);
    } else {
      int y, z;
      cin >> y >> z;
      cin >> x;
      belt[y][z] = x;
      a = M * ((y - 1) / M) + 1;
      b = min(M * ((y - 1) / M) + M, n);
      update(a, b);
    }
  }
}
