#include <bits/stdc++.h>
using namespace std;
int n, m, q, size, amt;
char maz[100010][20];
int vis[100010][20];
pair<int, int> to[100010][20];
void find(int x, int y, int up) {
  vis[x][y] = 1;
  if (maz[x][y] == '^')
    if (x == up)
      to[x][y] = make_pair(x - 1, y);
    else
      to[x][y] = to[x - 1][y];
  else if (maz[x][y] == '<')
    if (y == 1)
      to[x][y] = make_pair(x, 0);
    else if (maz[x][y - 1] == '>')
      to[x][y] = make_pair(-1, -1);
    else
      to[x][y] = to[x][y - 1];
  else if (y == m)
    to[x][y] = make_pair(x, m + 1);
  else if (maz[x][y + 1] == '<')
    to[x][y] = make_pair(-1, -1);
  else {
    find(x, y + 1, up);
    to[x][y] = to[x][y + 1];
  }
}
void update(int block) {
  int up = block * size + 1, down = (block + 1) * size;
  for (int i = up; i <= n && i <= down; i++)
    for (int j = 1; j <= m; j++) vis[i][j] = 0;
  for (int i = up; i <= n && i <= down; i++)
    for (int j = 1; j <= m; j++)
      if (!vis[i][j]) find(i, j, up);
}
void query(pair<int, int> p) {
  pair<int, int> tmp;
  while (p.first > 0 && p.second > 0 && p.second <= m) {
    tmp = to[p.first][p.second];
    p = tmp;
  }
  printf("%d %d\n", p.first, p.second);
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) scanf("%s", maz[i] + 1);
  size = sqrt(0.5 + n);
  amt = n / size;
  if (amt * size < n) amt++;
  for (int i = 0; i < amt; i++) update(i);
  while (q--) {
    char op[5], c[5];
    int x, y;
    scanf("%s%d%d", op, &x, &y);
    if (op[0] == 'A')
      query(make_pair(x, y));
    else {
      scanf("%s", c);
      maz[x][y] = c[0];
      update((x - 1) / size);
    }
  }
  return 0;
}
