#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int sx, sy, gy, gx;
vector<string> mat;
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
long long dis(int y1, int y2, int x2, int x1) {
  return abs(y2 - y1) + abs(x2 - x1);
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    mat.push_back(str);
    for (int j = 0; j < str.size(); j++) {
      if (str[j] == 'S') {
        sx = j;
        sy = i;
      }
      if (str[j] == 'T') {
        gx = j;
        gy = i;
      }
    }
  }
  priority_queue<
      pair<long long, pair<pair<string, long long>, long long> >,
      vector<pair<long long, pair<pair<string, long long>, long long> > >,
      greater<pair<long long, pair<pair<string, long long>, long long> > > >
      pq;
  pq.push(
      make_pair(dis(gy, sy, gx, sx), make_pair(make_pair("", 0), sy * m + sx)));
  set<pair<long long, long long> > ss;
  while (!pq.empty()) {
    int nt = pq.top().first;
    string nstr = pq.top().second.first.first;
    int nmask = pq.top().second.first.second;
    int nx = pq.top().second.second % m;
    int ny = pq.top().second.second / m;
    int nn = pq.top().second.second;
    pq.pop();
    if (ss.count(make_pair(nn, nmask))) continue;
    ss.insert(make_pair(nn, nmask));
    for (int i = 0; i < 4; i++) {
      int ax = nx + dx[i];
      int ay = ny + dy[i];
      if (ax < 0 || ax >= m || ay < 0 || ay >= n) continue;
      if (ay == gy && ax == gx) {
        cout << nstr << endl;
        return 0;
      }
      string astr = nstr + mat[ay][ax];
      int nnmask = nmask | (1 << (mat[ay][ax] - 'a'));
      if (__builtin_popcount(nnmask) <= k) {
        pq.push(make_pair(dis(ay, gy, ax, gx) + astr.size(),
                          make_pair(make_pair(astr, nnmask), ay * m + ax)));
      }
    }
  }
  cout << -1 << endl;
  return 0;
}
