#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y, msk;
  string s;
  node(int x1, int x2, int x3, string x4) { x = x1, y = x2, msk = x3, s = x4; }
  bool operator<(const node &b) const {
    if (s.size() != b.s.size()) return s.size() > b.s.size();
    return s > b.s;
  }
};
int gx[5] = {0, 1, 0, -1, 0}, gy[5] = {0, 0, 1, 0, -1};
char s[51][51];
set<int> st[51][51];
int las[51][51];
int count(int x) {
  int ans = 0;
  while (x) ans += x & 1, x >>= 1;
  return ans;
}
signed main() {
  int x = 0, y = 0;
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) cin >> s[i] + 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (s[i][j] == 'S') x = i, y = j;
  priority_queue<node> q;
  q.push(node(x, y, 0, ""));
  while (!q.empty()) {
    node u = q.top();
    q.pop();
    for (int i = 1; i <= 4; i++) {
      int tox = u.x + gx[i];
      int toy = u.y + gy[i];
      if (tox > n || toy > m || tox <= 0 || toy <= 0) continue;
      if (s[tox][toy] == 'T') {
        cout << u.s;
        return 0;
      }
      int mk = u.msk | (1 << (s[tox][toy] - 'a'));
      if (count(mk) > k) continue;
      if (las[tox][toy] && ((las[tox][toy] & mk) == las[tox][toy])) continue;
      las[tox][toy] = mk;
      if (st[tox][toy].count(mk)) continue;
      st[tox][toy].insert(mk);
      string tmp = u.s;
      q.push(node(tox, toy, mk, u.s + s[tox][toy]));
    }
  }
  printf("-1");
  return 0;
}
