#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
char field[55][55];
int n, m, k;
int can;
int sx, sy, tx, ty;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
string ans;
vector<char> vt;
bool out(int x, int y) { return x < 0 || x >= n || y < 0 || y >= m; }
void cal() {
  int dist[55][55];
  fill(dist[0], dist[n], INF);
  queue<pair<int, int> > Q;
  Q.push(make_pair(tx, ty));
  dist[tx][ty] = 0;
  while (!Q.empty()) {
    pair<int, int> now = Q.front(), next;
    Q.pop();
    if (now == make_pair(sx, sy)) {
      break;
    }
    for (int i = 0; i < 4; i++) {
      next = now;
      next.first += dx[i];
      next.second += dy[i];
      if (out(next.first, next.second) ||
          dist[next.first][next.second] != INF) {
        continue;
      }
      if (next != make_pair(sx, sy) &&
          (can & (1 << field[next.first][next.second] - 'a')) == 0) {
        continue;
      }
      dist[next.first][next.second] = dist[now.first][now.second] + 1;
      Q.push(next);
    }
  }
  if (dist[sx][sy] == INF) {
    return;
  }
  int len = dist[sx][sy] - 1;
  if (ans != "-1" && len > ans.length()) {
    return;
  }
  string path;
  vector<pair<int, int> > vt[2];
  int p = 0, q = 1;
  vt[p].push_back(make_pair(sx, sy));
  for (int i = 0; i < len; i++) {
    vt[q].clear();
    for (vector<pair<int, int> >::iterator it = vt[p].begin();
         it != vt[p].end(); it++) {
      pair<int, int> now = *it, next;
      for (int i = 0; i < 4; i++) {
        next = now;
        next.first += dx[i];
        next.second += dy[i];
        if (out(next.first, next.second) ||
            dist[next.first][next.second] != dist[now.first][now.second] - 1) {
          continue;
        }
        if (vt[q].empty()) {
          vt[q].push_back(next);
        } else {
          pair<int, int> &f = vt[q].front();
          if (field[f.first][f.second] > field[next.first][next.second]) {
            vt[q].clear();
            vt[q].push_back(next);
          } else if (field[f.first][f.second] ==
                     field[next.first][next.second]) {
            vt[q].push_back(next);
          }
        }
      }
    }
    sort(vt[q].begin(), vt[q].end());
    vt[q].resize(unique(vt[q].begin(), vt[q].end()) - vt[q].begin());
    pair<int, int> &f = vt[q].front();
    path += field[f.first][f.second];
    swap(p, q);
  }
  if (ans == "-1" || len < ans.length()) {
    ans = path;
    return;
  }
  if (ans > path) {
    ans = path;
  }
}
void dfs(int pos, int have) {
  if (have == k) {
    cal();
    return;
  }
  for (int i = pos; i < vt.size(); i++) {
    can ^= (1 << vt[i]);
    dfs(i + 1, have + 1);
    can ^= (1 << vt[i]);
  }
}
int dist(const pair<int, int> &a, const pair<int, int> &b) {
  return abs(a.first - b.first) + abs(a.second - b.second);
}
struct Node {
  string path;
  pair<int, int> pos;
  int mask;
  Node() {}
  Node(string _path, pair<int, int> _pos, int _mask) {
    path = _path;
    pos = _pos;
    mask = _mask;
  }
};
pair<int, int> T;
bool operator<(const Node &A, const Node &B) {
  if (A.path.length() + dist(A.pos, T) != B.path.length() + dist(B.pos, T)) {
    return A.path.length() + dist(A.pos, T) > B.path.length() + dist(B.pos, T);
  }
  return A.path > B.path;
}
inline int lowbit(int mask) { return mask & (-mask); }
inline int bitcount(int mask) {
  int cnt = 0;
  while (mask > 0) {
    cnt++;
    mask -= lowbit(mask);
  }
  return cnt;
}
int main() {
  for (; ~scanf("%d%d%d", &n, &m, &k);) {
    vt.clear();
    for (int i = 0; i < n; i++) {
      scanf("%s", field[i]);
      for (int j = 0; j < m; j++) {
        if (field[i][j] == 'S') {
          sx = i;
          sy = j;
        } else if (field[i][j] == 'T') {
          tx = i;
          ty = j;
        } else {
          vt.push_back(field[i][j] - 'a');
        }
      }
    }
    string ans = "-1";
    set<pair<int, int> > iset;
    T = make_pair(tx, ty);
    priority_queue<Node> PQ;
    PQ.push(Node("", make_pair(sx, sy), 0));
    while (!PQ.empty()) {
      Node now = PQ.top();
      PQ.pop();
      if (now.pos == T) {
        ans = now.path;
        break;
      }
      if (iset.count(
              make_pair(now.mask, now.pos.first * 100 + now.pos.second)) > 0) {
        continue;
      }
      iset.insert(make_pair(now.mask, now.pos.first * 100 + now.pos.second));
      for (int i = 0; i < 4; i++) {
        pair<int, int> npos = now.pos;
        npos.first += dx[i];
        npos.second += dy[i];
        if (out(npos.first, npos.second)) {
          continue;
        }
        int mask = now.mask;
        string path = now.path;
        if (field[npos.first][npos.second] != 'T') {
          mask |= 1 << (field[npos.first][npos.second] - 'a');
          path += field[npos.first][npos.second];
        }
        if (iset.count(make_pair(mask, npos.first * 100 + npos.second)) > 0) {
          continue;
        }
        if (bitcount(mask) <= k) {
          PQ.push(Node(path, npos, mask));
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
