#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 100;
const int maxM = (int)1e3 + 100;
const int mod = (int)1e9 + 7;
const int maxlog = (int)20;
const int P = mod;
int n, m, q, k, dpx[maxn][14], dpy[maxn][14];
char c[maxn][15];
inline void build(int l, int r) {
  for (int i = l; i <= r; i++)
    for (int j = 1; j <= m; j++) dpx[i][j] = dpy[i][j] = -1;
  for (int i = 1; i <= m; i++)
    if (c[l][i] == '^') dpx[l][i] = l - 1, dpy[l][i] = i;
  for (int i = l; i <= r; i++) {
    dpx[i][0] = i;
    dpy[i][0] = 0;
    dpx[i][m + 1] = i;
    dpy[i][m + 1] = m + 1;
  }
  for (int i = l; i <= r; i++) {
    for (int j = 1; j <= m; j++) {
      if (i != l && c[i][j] == '^') {
        dpx[i][j] = dpx[i - 1][j];
        dpy[i][j] = dpy[i - 1][j];
      } else if (c[i][j] == '<') {
        dpx[i][j] = dpx[i][j - 1];
        dpy[i][j] = dpy[i][j - 1];
      }
    }
    for (int j = m; j >= 1; j--) {
      if (c[i][j] == '>') {
        dpx[i][j] = dpx[i][j + 1];
        dpy[i][j] = dpy[i][j + 1];
      }
    }
  }
}
int main() {
  k = 320;
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) cin >> c[i][j];
  }
  for (int i = 1; i <= n; i += k) {
    build(i, min(n, i + k - 1));
  }
  while (q--) {
    char type, C;
    int x, y;
    cin >> type >> x >> y;
    if (type == 'C') {
      cin >> C;
      c[x][y] = C;
      build((x - 1) / k * k + 1, min(n, (x - 1) / k * k + 1 + k));
    } else {
      while (x > 0 && y > 0 && y <= m && x <= n) {
        int t = x;
        x = dpx[x][y];
        y = dpy[t][y];
      }
      cout << x << " " << y << endl;
    }
  }
  return 0;
}
