#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int S = 316;
int n, m, q;
char a[100050][15];
pair<int, int> snext[100050][15];
pair<int, int> lnext[100050][15];
void calcsnext(int x) {
  int i;
  vector<int> stack;
  for (i = 1; i <= m; i++) {
    if (a[x][i] == '>') {
      stack.push_back(i);
    } else if (a[x][i] == '^') {
      for (auto e : stack) snext[x][e] = pair<int, int>(x - 1, i);
      snext[x][i] = pair<int, int>(x - 1, i);
      stack.clear();
    }
    if (a[x][i] == '<') {
      if (stack.size()) {
        for (auto e : stack) snext[x][e] = pair<int, int>(-1, -1);
        snext[x][i] = pair<int, int>(-1, -1);
        stack.clear();
      } else {
        snext[x][i] = snext[x][i - 1];
      }
    }
  }
  for (auto e : stack) snext[x][e] = pair<int, int>(x, m + 1);
}
pair<int, int> u[15][400];
pair<int, int> d[400][15];
void calclnext(int x) {
  int i, j;
  for (i = 1; i <= m; i++) {
    pair<int, int> now = pair<int, int>(x, i);
    for (j = 0; j <= S; j++) {
      u[i][j] = now;
      if (now.first != -1) now = snext[now.first][now.second];
    }
    lnext[x][i] = u[i][S];
    d[0][i] = pair<int, int>(x, i);
  }
  for (i = x + 1; i <= min(n, x + S - 1); i++) {
    for (j = 1; j <= m; j++) {
      if (snext[i][j].first == -1) {
        d[i - x][j] = pair<int, int>(-1, -1);
        lnext[i][j] = pair<int, int>(-1, -1);
      } else if (snext[i][j].first == i) {
        d[i - x][j] = snext[i][j];
        lnext[i][j] = snext[i][j];
      } else {
        d[i - x][j] = d[i - x - 1][snext[i][j].second];
        if (d[i - x][j].first != x) {
          lnext[i][j] = d[i - x][j];
        } else {
          lnext[i][j] = u[d[i - x][j].second][S - (i - x)];
        }
      }
    }
  }
}
int main() {
  int i, j, k;
  scanf("%d%d%d", &n, &m, &q);
  for (i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  for (i = 1; i <= n; i++)
    snext[i][0] = lnext[i][0] = pair<int, int>(i, 0),
    snext[i][m + 1] = lnext[i][m + 1] = pair<int, int>(i, m + 1);
  for (i = 1; i <= m; i++) snext[0][i] = lnext[0][i] = pair<int, int>(0, i);
  for (i = 1; i <= n; i++) {
    calcsnext(i);
  }
  for (i = 1; i <= n; i += S) {
    calclnext(i);
  }
  for (i = 0; i < q; i++) {
    char x[2], w[2];
    int y, z;
    scanf("%s", x);
    if (x[0] == 'A') {
      scanf("%d%d", &y, &z);
      pair<int, int> now = pair<int, int>(y, z), tnow;
      while (1) {
        tnow = now;
        now = lnext[now.first][now.second];
        if (now.first == tnow.first || now.first == -1) {
          printf("%d %d\n", now.first, now.second);
          break;
        }
      }
    } else if (x[0] == 'C') {
      scanf("%d%d%s", &y, &z, w);
      a[y][z] = w[0];
      calcsnext(y);
      calclnext(y);
    }
  }
  return 0;
}
