#include <bits/stdc++.h>
using namespace std;
void Print() { cout << endl; }
template <typename T1, typename... T>
void Print(const T1 &t1, const T &...t) {
  cout << t1 << " ";
  Print(t...);
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
const int MAX = 1e5 + 9, MAX2 = 12, SQ = 320;
int qx[MAX][MAX2], qy[MAX][MAX2], n, m, q;
char ch[MAX][MAX2];
bool valid(int x, int y) { return (x < n && y < m && x >= 0 && y >= 0); }
void upd(int l, int r) {
  for (int i = l; i < r; ++i)
    for (int j = 0; j < m - 1; ++j)
      if (ch[i][j] == '>' && ch[i][j + 1] == '<')
        qx[i][j] = qx[i][j + 1] = qy[i][j] = qy[i][j + 1] = -2;
  for (int i = l; i < r; ++i) {
    for (int j = 0; j < m; ++j)
      if (ch[i][j] == '^') {
        if (i != l)
          qx[i][j] = qx[i - 1][j], qy[i][j] = qy[i - 1][j];
        else
          qx[i][j] = i - 1, qy[i][j] = j;
      }
    for (int j = 0; j < m; ++j)
      if (ch[i][j] == '<') {
        if (j)
          qx[i][j] = qx[i][j - 1], qy[i][j] = qy[i][j - 1];
        else
          qx[i][j] = i, qy[i][j] = -1;
      }
    for (int j = m - 1; j >= 0; --j)
      if (ch[i][j] == '>') {
        if (j != m - 1)
          qx[i][j] = qx[i][j + 1], qy[i][j] = qy[i][j + 1];
        else
          qx[i][j] = i, qy[i][j] = m;
      }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m >> q;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cin >> ch[i][j];
  for (int i = 0; i < n; i += SQ) upd(i, min(n, i + SQ));
  while (q--) {
    char op, c;
    int x, y;
    cin >> op >> x >> y;
    --x, --y;
    if (op == 'A') {
      int tx, ty;
      while (valid(x, y)) tx = qx[x][y], ty = qy[x][y], x = tx, y = ty;
      Print(x + 1, y + 1);
    } else {
      cin >> c;
      ch[x][y] = c;
      upd((x / SQ) * SQ, min((x / SQ + 1) * SQ, n));
    }
  }
  return 0;
}
