#include <bits/stdc++.h>
using std::bitset;
using std::cin;
using std::complex;
using std::cout;
using std::endl;
using std::fixed;
using std::greater;
using std::ios_base;
using std::lower_bound;
using std::make_pair;
using std::map;
using std::max;
using std::min;
using std::multiset;
using std::next_permutation;
using std::ostream;
using std::pair;
using std::prev_permutation;
using std::random_shuffle;
using std::reverse;
using std::set;
using std::setprecision;
using std::sort;
using std::string;
using std::swap;
using std::upper_bound;
using std::vector;
using std::ws;
template <class C>
void mini(C& a4, C b4) {
  a4 = min(a4, b4);
}
template <class C>
void maxi(C& a4, C b4) {
  a4 = max(a4, b4);
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> pair) {
  return out << "(" << pair.first << ", " << pair.second << ")";
}
const long long N = 1e5 + 5;
const long long M = 1 << 18;
struct Node {
  vector<pair<long long, long long> > pos;
};
Node drz[2 * M + 5];
string s[N];
long long m;
void Fix(long long r) {
  vector<pair<long long, long long> > res;
  res.resize(m + 2);
  for (long long i = (1); i <= (m); ++i) {
    if (s[r][i] == '>') {
      long long end = i + 1;
      while (end <= m && s[r][end] == '>') {
        end++;
      }
      if (end > m) {
        res[i] = make_pair(r, m + 1);
      } else if (s[r][end] == '<') {
        res[i] = make_pair(-1, -1);
      } else {
        res[i] = make_pair(-2, end);
      }
    } else if (s[r][i] == '<') {
      long long beg = i - 1;
      while (beg && s[r][beg] == '<') {
        beg--;
      }
      if (beg == 0) {
        res[i] = make_pair(r, 0);
      } else if (s[r][beg] == '>') {
        res[i] = make_pair(-1, -1);
      } else {
        res[i] = make_pair(-2, beg);
      }
    } else {
      res[i] = make_pair(-2, i);
    }
  }
  drz[M + r - 1].pos = res;
  ;
}
long long deb;
vector<pair<long long, long long> > Merge(
    vector<pair<long long, long long> >& fir,
    vector<pair<long long, long long> >& sec) {
  vector<pair<long long, long long> > res;
  res.resize(m + 2);
  if (deb) {
    if (0) cout << "Merguje \n";
    ;
    ;
  }
  for (long long i = (1); i <= (m); ++i) {
    if (sec[i].first != -2) {
      res[i] = sec[i];
    } else {
      res[i] = fir[sec[i].second];
    }
  }
  return res;
}
void Update(long long i) {
  Fix(i);
  i += M - 1;
  i /= 2;
  while (i) {
    drz[i].pos = Merge(drz[2 * i].pos, drz[2 * i + 1].pos);
    i /= 2;
  }
}
pair<long long, long long> Get(long long i, long long j) {
  vector<pair<long long, long long> > act = drz[M + i - 1].pos;
  i += M - 1;
  ;
  deb = 1;
  while (i > 1) {
    if (i % 2 == 1) {
      act = Merge(drz[i - 1].pos, act);
      ;
    }
    i /= 2;
  }
  deb = 0;
  return act[j];
}
int main() {
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  double beg_clock = 1.0 * clock() / CLOCKS_PER_SEC;
  long long n;
  cin >> n;
  ;
  cin >> m;
  long long q;
  cin >> q;
  ;
  vector<pair<long long, long long> > nic;
  nic.resize(m + 2);
  for (long long i = (1); i <= (2 * M); ++i) {
    drz[i].pos = nic;
  }
  for (long long i = (1); i <= (n); ++i) {
    cin >> ws;
    getline(cin, s[i]);
    s[i] = ' ' + s[i];
    Update(i);
  }
  for (long long i = (1); i <= (q); ++i) {
    char c;
    cin >> c;
    ;
    if (c == 'A') {
      long long x, y;
      cin >> x >> y;
      ;
      auto res = Get(x, y);
      if (res.first == -2) {
        res.first = 0;
      }
      cout << res.first << " " << res.second << "\n";
    } else {
      long long x, y;
      cin >> x >> y;
      ;
      cin >> s[x][y];
      Update(x);
    }
  }
  return 0;
}
