#include <bits/stdc++.h>
using namespace std;
char c[100010][11];
pair<int, int> rez[100010][11];
int viz[100010][11], n, m;
void son(int &i, int &j) {
  if (c[i][j] == '>')
    j++;
  else if (c[i][j] == '<')
    j--;
  else
    i--;
}
void find_path(int i, int j, int x, int y) {
  rez[i][j] = make_pair(-1, -1);
  viz[i][j] = 1;
  int ci = i;
  int cj = j;
  son(ci, cj);
  if (cj < 1 || cj > m || ci < x || ci > y) {
    rez[i][j] = make_pair(ci, cj);
    return;
  }
  if (!viz[ci][cj]) find_path(ci, cj, x, y);
  rez[i][j] = rez[ci][cj];
}
int main() {
  int q, i, b, B, j, x, y, ix, iy, cx, cy;
  cin >> n >> m >> q;
  B = max(1, (int)sqrt(n / m));
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> c[i][j];
    }
  }
  for (b = 0; b * B + 1 <= n; b++) {
    for (i = b * B + 1; i <= b * B + B && i <= n; i++) {
      for (j = 1; j <= m; j++) {
        if (!viz[i][j]) find_path(i, j, b * B + 1, B * (b + 1));
      }
    }
  }
  memset(viz, 0, sizeof(viz));
  while (q--) {
    cin >> c[0][0];
    if (c[0][0] == 'A') {
      cin >> x >> y;
      while (x >= 1 && y >= 1 && x <= n && y <= m) {
        cx = rez[x][y].first;
        cy = rez[x][y].second;
        x = cx;
        y = cy;
      }
      cout << x << " " << y << "\n";
    } else {
      cin >> x >> y;
      cin >> c[x][y];
      b = (x - 1) / B;
      for (i = b * B + 1; i <= b * B + B && i <= n; i++) {
        for (j = 1; j <= m; j++) {
          find_path(i, j, b * B + 1, B * (b + 1));
        }
      }
      for (i = b * B + 1; i <= b * B + B && i <= n; i++) {
        for (j = 1; j <= m; j++) {
          viz[i][j] = 0;
        }
      }
    }
  }
}
