#include <bits/stdc++.h>
using namespace std;
int SIZE, n, m;
char a[100005][15];
pair<int, int> ans[100005][15];
int visit[100005][15], value = 1;
inline bool inside(int x, int y, int nx, int ny) {
  return (x / SIZE == nx / SIZE) && nx >= 1 && nx <= n && ny >= 1 && ny <= m;
}
void dfs(int x, int y) {
  visit[x][y] = value;
  ans[x][y] = make_pair(-1, -1);
  int nx, ny;
  switch (a[x][y]) {
    case '>':
      nx = x, ny = y + 1;
      break;
    case '<':
      nx = x, ny = y - 1;
      break;
    case '^':
      nx = x - 1, ny = y;
      break;
  }
  if (!inside(x, y, nx, ny))
    ans[x][y] = make_pair(nx, ny);
  else {
    if (visit[nx][ny] != value) dfs(nx, ny);
    ans[x][y] = ans[nx][ny];
  }
}
const int dx[4] = {0, 0, -1, 1};
const int dy[4] = {-1, 1, 0, 0};
inline pair<int, int> nei(int x, int y) {
  switch (a[x][y]) {
    case '<':
      return make_pair(x, y - 1);
    case '>':
      return make_pair(x, y + 1);
    default:
      return make_pair(x - 1, y);
  }
}
void dfs2(int x, int y) {
  visit[x][y] = value;
  for (int i = 0; i < 4; i++) {
    int nx = x + dx[i], ny = y + dy[i];
    if (nei(nx, ny) == make_pair(x, y)) {
      if (inside(x, y, nx, ny)) {
        ans[nx][ny] = ans[x][y];
        if (visit[nx][ny] != value) dfs2(nx, ny);
      }
    }
  }
}
int main() {
  int q;
  scanf("%d %d %d ", &n, &m, &q);
  for (int i = 1; i <= n; i++) gets(a[i] + 1);
  SIZE = (int)sqrt(n);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (visit[i][j] != value) {
        dfs(i, j);
      }
    }
  }
  char opt, c;
  int x, y;
  while (q--) {
    scanf(" %c %d %d", &opt, &x, &y);
    if (opt == 'A') {
      int nx, ny;
      nx = ans[x][y].first;
      ny = ans[x][y].second;
      while (nx >= 1 && nx <= n && ny >= 1 && ny <= m) {
        x = nx, y = ny;
        nx = ans[x][y].first;
        ny = ans[x][y].second;
      }
      printf("%d %d\n", nx, ny);
    } else {
      scanf(" %c", &c);
      a[x][y] = c;
      value++;
      dfs(x, y);
      value++;
      dfs2(x, y);
    }
  }
  return 0;
}
