#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int M = 12;
const int SQRT = 350 + 7;
string s[N];
pair<int, int> pos[N][M];
int n, m, q;
void update(int x) {
  int l = x * SQRT;
  int r = min(n, x * SQRT + SQRT);
  for (int i = l; i < r; i++) {
    for (int j = 0; j < m; j++)
      pos[i][j] =
          make_pair(i + (s[i][j] == '^' ? -1 : 0),
                    j + (s[i][j] == '^' ? 0 : (s[i][j] == '<' ? -1 : 1)));
    for (int j = 0; j < m; j++) {
      int R = pos[i][j].first;
      int C = pos[i][j].second;
      if (R < r && R >= l && C >= 0 && C < m && pos[R][C] == make_pair(i, j))
        pos[i][j] = make_pair(-2, -2);
      else if (R < r && R >= l && C >= 0 && C < m && pos[R][C].first >= l)
        pos[i][j] = pos[R][C];
    }
    for (int j = m - 1; j >= 0; j--) {
      int R = pos[i][j].first;
      int C = pos[i][j].second;
      if (R < r && R >= l && C >= 0 && C < m && pos[R][C] == make_pair(i, j))
        pos[R][C] = make_pair(-2, -2);
      else if (R < r && R >= l && C >= 0 && C < m && pos[R][C].first >= l)
        pos[i][j] = pos[R][C];
    }
  }
}
pair<int, int> get(int r, int c) {
  while (r >= 0 && c >= 0 && c < m) {
    pair<int, int> p = pos[r][c];
    r = p.first;
    c = p.second;
  }
  return make_pair(r, c);
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i * SQRT < n; i++) update(i);
  while (q--) {
    char c;
    cin >> c;
    if (c == 'A') {
      int r, c;
      cin >> r >> c;
      r--, c--;
      pair<int, int> p = get(r, c);
      cout << p.first + 1 << " " << p.second + 1 << "\n";
    } else {
      int r, c;
      char t;
      cin >> r >> c >> t;
      r--, c--;
      s[r][c] = t;
      update(r / SQRT);
    }
  }
  return 0;
}
