#include <bits/stdc++.h>
using namespace std;
long long int powmod(long long int a, int b, int n) {
  long long int rm = 1;
  while (b) {
    if (b % 2) {
      rm = (rm * a) % n;
    }
    a = (a * a) % n;
    b /= 2;
  }
  return rm;
}
const int N = 100009;
const int sqN = 320;
int worst = 1e8;
pair<int, int> prc[N][11];
int n, m;
char g[N][12];
char qtype[N][3], qc2[N][3];
int qr[N], qc[N];
bool visited[sqN + 10][11][2];
int high[N], low[N];
pair<int, int> go(int r, int c) {
  if (prc[r][c].first != -10) return prc[r][c];
  prc[r][c].first = worst;
  prc[r][c].second = 0;
  pair<int, int> next;
  if (g[r][c] == '<') {
    if (c == 0) {
      next.first = r;
      next.second = -1;
    } else
      next = go(r, c - 1);
  } else if (g[r][c] == '>') {
    if (c == m - 1) {
      next.first = r;
      next.second = m;
    } else
      next = go(r, c + 1);
  } else if (g[r][c] == '^') {
    if (r == low[r]) {
      next.first = low[r] - 1;
      next.second = c;
    } else
      next = go(r - 1, c);
  }
  prc[r][c] = next;
  return next;
}
void update(int mn_r, int mx_r) {
  for (int i = mn_r; i <= mx_r; ++i)
    for (int c = 0; c < m; ++c) prc[i][c].first = -10;
  for (int r = mn_r; r <= mx_r; ++r) {
    for (int c = 0; c < m; ++c) {
      if (prc[r][c].first == -10) {
        go(r, c);
      }
    }
  }
}
pair<int, int> query(int r, int c, int level) {
  if (level < 5 && visited[r / sqN][c][level]) return make_pair(worst, 0);
  if (level < 5) visited[r / sqN][c][level] = true;
  if (prc[r][c].first == worst) return prc[r][c];
  if (prc[r][c].second < 0 || prc[r][c].second >= m || prc[r][c].first < 0 ||
      prc[r][c].first >= n)
    return prc[r][c];
  pair<int, int> next = prc[r][c];
  if (next.first < low[r])
    return query(next.first, next.second, 1);
  else
    return query(next.first, next.second, 0);
}
int main() {
  int Q;
  scanf("%d%d%d", &n, &m, &Q);
  for (int i = int(1); i <= (int)n; i++) scanf("%s", g[i - 1]);
  for (int i = 0; i < n; i += sqN) {
    high[i] = min(n - 1, i + sqN - 1);
    for (int j = i; j <= high[i]; ++j) {
      low[j] = i;
      high[j] = high[i];
    }
  }
  for (int i = 0; i < n; i += sqN) update(low[i], high[i]);
  int ct = 0;
  for (int i = int(1); i <= (int)Q; i++) {
    scanf("%s%d%d", qtype[i], &qr[i], &qc[i]);
    qr[i]--;
    qc[i]--;
    if (qtype[i][0] == 'C') scanf("%s", qc2[i]);
    if (qtype[i][0] == 'A') {
      ct++;
      memset(visited, false, sizeof(visited));
      pair<int, int> ans = query(qr[i], qc[i], 6);
      if (ans.first == worst)
        printf("-1 -1\n");
      else
        printf("%d %d\n", ans.first + 1, ans.second + 1);
    } else {
      g[qr[i]][qc[i]] = qc2[i][0];
      update(low[qr[i]], high[qr[i]]);
    }
  }
  return 0;
}
