#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 10;
const int M = 14;
const int pow2 = (1 << 17);
int nSize, mSize;
char table[N][M];
int mainPos[M];
void recalcLevel(pair<int, int> *arr, int l) {
  int cntPos = 0;
  mainPos[cntPos++] = -1;
  for (int s = 0; s < mSize; s++) arr[s] = make_pair(-2, -2);
  for (int s = 0; s < mSize; s++) {
    if (table[l][s] == '^') {
      mainPos[cntPos++] = s;
      arr[s] = make_pair(l - 1, s);
    }
  }
  mainPos[cntPos++] = mSize;
  for (int s = 0; s < cntPos; s++) {
    int p = mainPos[s];
    int delta = 1;
    while (p - delta >= 0 && table[l][p - delta] == '>') {
      arr[p - delta] = make_pair(l - (p != mSize ? 1 : 0), p);
      delta++;
    }
    delta = 1;
    while (p + delta < mSize && table[l][p + delta] == '<') {
      arr[p + delta] = make_pair(l - (p != -1 ? 1 : 0), p);
      delta++;
    }
  }
}
void mergeTree(pair<int, int> *to, pair<int, int> *a, pair<int, int> *b,
               int coord) {
  for (int i = 0; i < mSize; i++) {
    pair<int, int> pos = b[i];
    to[i] = pos;
    if (pos.first != coord) continue;
    to[i] = a[pos.second];
  }
}
struct SegmentTree {
  pair<int, int> tree[pow2 * 2][M];
  void build(int v, int l, int r) {
    if (l == r) {
      for (int s = 0; s < mSize; s++) tree[v][s] = make_pair(-2, -2);
      if (l >= nSize) return;
      recalcLevel(tree[v], l);
      return;
    }
    int m = (l + r) / 2;
    build(2 * v, l, m);
    build(2 * v + 1, m + 1, r);
    mergeTree(tree[v], tree[2 * v], tree[2 * v + 1], m);
  }
  pair<int, int> getValue(int x, int y, int v = 1, int l = 0,
                          int r = pow2 - 1) {
    if (r == x) return tree[v][y];
    int m = (l + r) / 2;
    if (x > m) {
      pair<int, int> pos = getValue(x, y, 2 * v + 1, m + 1, r);
      if (pos.first != m) return pos;
      return tree[2 * v][pos.second];
    } else
      return getValue(x, y, 2 * v, l, m);
  }
  void changeValue(int x, int y, char c, int v = 1, int l = 0,
                   int r = pow2 - 1) {
    if (l == r) {
      table[x][y] = c;
      recalcLevel(tree[v], l);
      return;
    }
    int m = (l + r) / 2;
    if (x <= m)
      changeValue(x, y, c, 2 * v, l, m);
    else
      changeValue(x, y, c, 2 * v + 1, m + 1, r);
    mergeTree(tree[v], tree[2 * v], tree[2 * v + 1], m);
  }
} tree;
int main() {
  int q;
  scanf("%d%d%d", &nSize, &mSize, &q);
  for (int i = 0; i < nSize; i++) scanf(" %s", table[i]);
  tree.build(1, 0, pow2 - 1);
  for (int i = 0; i < q; i++) {
    char type;
    scanf(" %c", &type);
    if (type == 'A') {
      int x, y;
      scanf("%d%d", &x, &y);
      x--, y--;
      pair<int, int> pos = tree.getValue(x, y);
      printf("%d %d\n", pos.first + 1, pos.second + 1);
    } else {
      int x, y;
      char c;
      scanf("%d%d %c", &x, &y, &c);
      x--, y--;
      tree.changeValue(x, y, c);
    }
  }
  return 0;
}
