#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100007;
const int MAX_M = 12;
struct Trans {
  pair<int, int> a[12];
  Trans() {
    for (int i = 0; i < 12; ++i) a[i].first = -2;
  }
  Trans(int x) {
    for (int i = 0; i < 12; ++i) a[i] = pair<int, int>(-1, i);
  }
};
int L[MAX_N * 4];
int R[MAX_N * 4];
Trans trans[MAX_N * 4];
int n, m, q;
char s[MAX_N][MAX_M];
void calc_trans(Trans &res, int lnum) {
  for (int i = 0; i < 12; ++i) res.a[i].first = -2;
  if (lnum == 1) {
    for (int i = 1; i <= m; ++i) {
      if (s[lnum][i] == '^') res.a[i] = pair<int, int>(0, i);
    }
  } else {
    for (int i = 1; i <= m; ++i) {
      if (s[lnum][i] == '^') res.a[i] = pair<int, int>(-1, i);
    }
  }
  if (s[lnum][1] == '<') res.a[1] = pair<int, int>(lnum, 0);
  if (s[lnum][m] == '>') res.a[m] = pair<int, int>(lnum, m + 1);
  for (int i = 2; i <= m; ++i) {
    if (s[lnum][i] == '<' && res.a[i - 1].first != -2) res.a[i] = res.a[i - 1];
  }
  for (int i = m - 1; i >= 1; --i) {
    if (s[lnum][i] == '>' && res.a[i + 1].first != -2) res.a[i] = res.a[i + 1];
  }
}
void printT(Trans tt) {
  for (int j = 1; j <= m; ++j)
    printf("(%d %d) ", tt.a[j].first, tt.a[j].second);
  puts("");
}
Trans merge_trans(Trans t1, Trans t2) {
  for (int i = 1; i <= m; ++i) {
    if (t2.a[i].first == -1) t2.a[i] = t1.a[t2.a[i].second];
  }
  return t2;
}
struct SegTree {
  SegTree() {}
  void build(int k, int l, int r) {
    L[k] = l;
    R[k] = r;
    if (l == r) {
      calc_trans(trans[k], l);
      return;
    }
    build(k * 2, l, (l + r) >> 1);
    build(k * 2 + 1, (l + r + 2) >> 1, r);
    trans[k] = merge_trans(trans[k * 2], trans[k * 2 + 1]);
  }
  void modify(int k, int pos) {
    if (R[k] < pos) return;
    if (L[k] > pos) return;
    if (L[k] == R[k]) {
      calc_trans(trans[k], pos);
    } else {
      modify(k * 2, pos);
      modify(k * 2 + 1, pos);
      trans[k] = merge_trans(trans[k * 2], trans[k * 2 + 1]);
    }
  }
  Trans query(int k, int l, int r) {
    if (r < L[k] || l > R[k]) return Trans(1);
    if (l <= L[k] && R[k] <= r) return trans[k];
    return merge_trans(query(k * 2, l, r), query(k * 2 + 1, l, r));
  }
};
SegTree t;
char st[100];
int main() {
  int x, y;
  char c, cc;
  cin >> n >> m >> q;
  for (int i = 1; i <= n; ++i) {
    scanf("%s", &s[i][1]);
  }
  t.build(1, 1, n);
  getchar();
  for (int i = 0; i < q; ++i) {
    gets(st);
    if (st[0] == 'A') {
      sscanf(st, "%c %d %d", &cc, &x, &y);
      Trans tmp = t.query(1, 1, x);
      pair<int, int> p = tmp.a[y];
      if (p.first < 0) {
        cout << "-1 -1" << endl;
      } else {
        cout << p.first << " " << p.second << endl;
      }
    } else {
      sscanf(st, "%c %d %d %c", &cc, &x, &y, &c);
      s[x][y] = c;
      t.modify(1, x);
    }
  }
}
