#include <bits/stdc++.h>
using namespace std;
ifstream fin("test.in");
ofstream fout("test.out");
string s[100010];
int n, m, q;
vector<pair<int, int> > nxt[100010][12];
void calculate_line(int i) {
  for (int j = 0; j < m; ++j) {
    if (nxt[i][j].size() < 1) nxt[i][j].resize(1);
    if (s[i][j] == '^') {
      nxt[i][j][0].first = i - 1;
      nxt[i][j][0].second = j;
    }
  }
  for (int j = 0; j < m; ++j) {
    if (s[i][j] == '<') {
      if (j == 0) {
        nxt[i][j][0].first = i;
        nxt[i][j][0].second = -1;
      } else if (s[i][j - 1] == '>') {
        nxt[i][j][0].first = -1;
        nxt[i][j][0].second = -2;
      } else
        nxt[i][j][0] = nxt[i][j - 1][0];
    }
  }
  for (int j = m - 1; j >= 0; --j) {
    if (s[i][j] == '>') {
      if (j == m - 1) {
        nxt[i][j][0].first = i;
        nxt[i][j][0].second = m;
      } else if (s[i][j + 1] == '<') {
        nxt[i][j][0].first = -1;
        nxt[i][j][0].second = -2;
      } else
        nxt[i][j][0] = nxt[i][j + 1][0];
    }
  }
}
void build_aint() {
  for (int i = 1; i <= n; ++i) {
    calculate_line(i);
  }
  for (int p = 1; (1 << p) <= n; ++p) {
    for (int i = 1; i <= n; ++i) {
      if (i % (1 << p) == 0) {
        for (int j = 0; j < m; ++j) {
          int inter = nxt[i][j][p - 1].second;
          if (inter == -1 || inter == -2 || inter == m) {
            nxt[i][j].push_back(nxt[i][j][p - 1]);
          } else
            nxt[i][j].push_back(nxt[i - (1 << (p - 1))][inter][p - 1]);
        }
      }
    }
  }
}
pair<int, int> query(pair<int, int> now) {
  while (now.first > 0) {
    if (now.second == -1 || now.second == -2 || now.second == m) break;
    int lst = nxt[now.first][now.second].size() - 1;
    now = nxt[now.first][now.second][lst];
  }
  return now;
}
void update(pair<int, int> now, char c) {
  s[now.first][now.second] = c;
  calculate_line(now.first);
  int i = now.first;
  for (int p = 1; i <= n; ++p) {
    if (i % (1 << p) != 0) i += (1 << (p - 1));
    if (i > n) break;
    for (int j = 0; j < m; ++j) {
      int inter = nxt[i][j][p - 1].second;
      if (inter == -1 || inter == -2 || inter == m) {
        nxt[i][j][p] = nxt[i][j][p - 1];
      } else
        nxt[i][j][p] = nxt[i - (1 << (p - 1))][inter][p - 1];
    }
  }
}
int main() {
  cin >> n >> m >> q;
  for (int i = 1; i <= n; ++i) {
    cin >> s[i];
  }
  build_aint();
  for (int i = 1; i <= q; ++i) {
    char c;
    int first, second;
    cin >> c;
    if (c == 'A') {
      cin >> first >> second;
      pair<int, int> ans = query(make_pair(first, second - 1));
      ans.second++;
      cout << ans.first << " " << ans.second << "\n";
    } else {
      cin >> first >> second >> c;
      update(make_pair(first, second - 1), c);
    }
  }
}
