#include <bits/stdc++.h>
using namespace std;
pair<int, int> des[120000][12];
int n, m;
char mp[120000][12];
struct segement {
  int lef[520000], rig[520000];
  vector<int> adj[520000], tmp1, tmp2, tmp3;
  inline void getnew(int po, int x) {
    adj[po].resize(m);
    for (int i = 1; i <= m; i++) {
      int tp = i;
      while (tp != 0 && tp != m + 1) {
        if (mp[x][tp] == '^') {
          break;
        } else if (mp[x][tp] == '<') {
          if (tp != 1 && mp[x][tp - 1] == '>') {
            tp = -1;
            break;
          } else {
            tp--;
          }
        } else {
          if (tp != m && mp[x][tp + 1] == '<') {
            tp = -1;
            break;
          } else {
            tp++;
          }
        }
      }
      if (tp == 0) {
        adj[po][i - 1] = x * 100;
      } else if (tp == m + 1) {
        adj[po][i - 1] = x * 100 + m + 1;
      } else {
        adj[po][i - 1] = tp;
      }
    }
  }
  inline vector<int> update(vector<int> x, vector<int> y) {
    tmp3.resize(m);
    for (int i = 0; i < m; i++) {
      if (y[i] > 0 && y[i] <= m)
        tmp3[i] = x[y[i] - 1];
      else
        tmp3[i] = y[i];
    }
    return tmp3;
  }
  inline void build(int x, int le, int ri) {
    lef[x] = le;
    rig[x] = ri;
    if (le == ri) {
      getnew(x, le);
      return;
    }
    build(x * 2, le, (le + ri) / 2);
    build(x * 2 + 1, (le + ri) / 2 + 1, ri);
    adj[x] = update(adj[x * 2], adj[x * 2 + 1]);
  }
  inline void edit(int x, int pos) {
    if (lef[x] == rig[x]) {
      getnew(x, lef[x]);
      return;
    }
    if (pos <= rig[x * 2])
      edit(x * 2, pos);
    else
      edit(x * 2 + 1, pos);
    adj[x] = update(adj[x * 2], adj[x * 2 + 1]);
  }
  inline vector<int> query(int x, int le, int ri) {
    if (le <= lef[x] && ri >= rig[x]) return adj[x];
    if (le <= rig[x * 2] && ri >= lef[x * 2 + 1]) {
      return update(query(x * 2, le, ri), query(x * 2 + 1, le, ri));
    } else if (le <= rig[x * 2]) {
      return query(x * 2, le, ri);
    } else {
      return query(x * 2 + 1, le, ri);
    }
  }
} sgt;
char opt[20], op[20];
int x1, x2, q;
int main() {
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%s", mp[i] + 1);
  }
  sgt.build(1, 1, n);
  for (int i = 1; i <= q; i++) {
    scanf("%s %d %d", op + 1, &x1, &x2);
    if (op[1] == 'A') {
      int ttp = sgt.query(1, 1, x1)[x2 - 1];
      if (ttp == -1)
        printf("-1 -1\n");
      else
        printf("%d %d\n", ttp / 100, ttp % 100);
    } else {
      scanf("%s", opt + 1);
      mp[x1][x2] = opt[1];
      sgt.edit(1, x1);
    }
  }
  return 0;
}
