Problem: You already know that Valery's favorite sport is biathlon. Due to your help, he learned to shoot without missing, and his skills are unmatched at the shooting range. But now a smaller task is to be performed, he should learn to complete the path fastest.

The track's map is represented by a rectangle n × m in size divided into squares. Each square is marked with a lowercase Latin letter (which means the type of the plot), with the exception of the starting square (it is marked with a capital Latin letters S) and the terminating square (it is marked with a capital Latin letter T). The time of movement from one square to another is equal to 1 minute. The time of movement within the cell can be neglected. We can move from the cell only to side-adjacent ones, but it is forbidden to go beyond the map edges. Also the following restriction is imposed on the path: it is not allowed to visit more than k different types of squares (squares of one type can be visited an infinite number of times). Squares marked with S and T have no type, so they are not counted. But S must be visited exactly once — at the very beginning, and T must be visited exactly once — at the very end.

Your task is to find the path from the square S to the square T that takes minimum time. Among all shortest paths you should choose the lexicographically minimal one. When comparing paths you should lexicographically represent them as a sequence of characters, that is, of plot types.

Input

The first input line contains three integers n, m and k (1 ≤ n, m ≤ 50, n·m ≥ 2, 1 ≤ k ≤ 4). Then n lines contain the map. Each line has the length of exactly m characters and consists of lowercase Latin letters and characters S and T. It is guaranteed that the map contains exactly one character S and exactly one character T.

Pretest 12 is one of the maximal tests for this problem.

Output

If there is a path that satisfies the condition, print it as a sequence of letters — the plot types. Otherwise, print "-1" (without quotes). You shouldn't print the character S in the beginning and T in the end.

Note that this sequence may be empty. This case is present in pretests. You can just print nothing or print one "End of line"-character. Both will be accepted.

Examples

Input

5 3 2
Sba
ccc
aac
ccc
abT


Output

bcccc


Input

3 4 1
Sxyy
yxxx
yyyT


Output

xxxx


Input

1 3 3
TyS


Output

y


Input

1 4 1
SxyT


Output

-1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const long long LINF = 1000000000000000000LL;
void prepare() {}
int n, m, k;
char x[55][55];
pair<int, int> start, finish;
int rev[255];
char rev2[10];
struct mystring {
  vector<int> a;
  int sz;
  mystring() { sz = 10; }
  void push_back(char x) {
    if (x == 'T') return;
    if (sz == 10) {
      a.push_back(rev[x] << 27);
      sz = 1;
    } else {
      sz++;
      a[a.size() - 1] |= (rev[x] << (3 * (10 - sz)));
    }
  }
  string get(int q, int sz) {
    string ret = "";
    ret.resize(sz);
    for (int i = 0; i < sz; i++) {
      ret[i] = rev2[(q >> (3 * (9 - i))) & 7];
    }
    return ret;
  }
  string c_str() {
    if (a.size() == 0) return "";
    string ret = "";
    for (int i = 0; i < a.size() - 1; i++) ret += get(a[i], 10);
    return ret + get(a[a.size() - 1], sz);
  }
};
bool operator<(const mystring &a, const mystring &b) {
  for (int i = 0; i < a.a.size(); i++)
    if (a.a[i] != b.a[i]) return a.a[i] < b.a[i];
  return false;
}
bool operator>(const mystring &a, const mystring &b) {
  for (int i = 0; i < a.a.size(); i++)
    if (a.a[i] != b.a[i]) return a.a[i] > b.a[i];
  return false;
}
bool ok[256];
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
queue<pair<int, int> > dq;
int dp[55][55];
pair<int, int> last[55][55];
string rew[55][55];
string getans() {
  int sz = dp[finish.first][finish.second];
  if (sz == INF) return "";
  pair<int, int> cur = finish;
  string ret = "";
  for (int i = 0; i < sz - 1; i++) {
    cur = last[cur.first][cur.second];
    ret += x[cur.first][cur.second];
  }
  reverse(ret.begin(), ret.end());
  return ret;
}
inline string rewind(pair<int, int> z) {
  string ret = "";
  int gg = dp[z.first][z.second], i = 0;
  ret.resize(gg + 1);
  while (z.first != -1) {
    ret[gg - i] = x[z.first][z.second];
    z = last[z.first][z.second];
    i++;
  }
  return ret;
}
bool dij() {
  for (int i = 0; i < 55; i++)
    for (int j = 0; j < 55; j++) {
      dp[i][j] = INF;
      rew[i][j] = "";
    }
  dp[start.first][start.second] = 0;
  dq.push(start);
  while (!dq.empty()) {
    pair<int, int> cur = dq.front();
    dq.pop();
    string r = rew[cur.first][cur.second];
    if (cur != start) r.push_back(x[cur.first][cur.second]);
    for (int k = 0; k < 4; k++) {
      int nr = cur.first + dy[k];
      int nc = cur.second + dx[k];
      if (nr >= 0 && nr < n && nc >= 0 && nc < m)
        if (ok[x[nr][nc]]) {
          int nval = dp[cur.first][cur.second] + 1;
          if (dp[nr][nc] > nval) {
            dp[nr][nc] = nval;
            rew[nr][nc] = r;
            dq.push(make_pair(nr, nc));
          } else if (dp[nr][nc] == nval) {
            if (rew[nr][nc] > r) rew[nr][nc] = r;
          }
        }
    }
  }
  return dp[finish.first][finish.second] != INF;
}
pair<int, string> ans;
bool use[256];
int qq;
void go(int it, char last) {
  if (it == 0) {
    if (dij()) {
      pair<int, string> tmp = make_pair(dp[finish.first][finish.second],
                                        rew[finish.first][finish.second]);
      if (ans > tmp) ans = tmp;
    }
    return;
  }
  for (char x = last; x <= 'z'; x++)
    if (use[x]) {
      ok[x] = true;
      rev[x] = 5 - it;
      rev2[5 - it] = x;
      go(it - 1, x + 1);
      ok[x] = false;
    }
}
bool solve() {
  memset(use, 0, sizeof(use));
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    scanf("%s", x[i]);
    for (int j = 0; j < m; j++) {
      use[x[i][j]] = true;
      if (x[i][j] == 'S')
        start = make_pair(i, j);
      else if (x[i][j] == 'T')
        finish = make_pair(i, j);
    }
  }
  memset(ok, 0, sizeof(ok));
  ok['S'] = true;
  ok['T'] = true;
  int sk = 0;
  for (char a = 'a'; a <= 'z'; a++)
    if (use[a]) sk++;
  k = min(k, sk);
  ans = make_pair(INF, "Z");
  go(k, 'a');
  if (ans.first == INF)
    printf("-1\n");
  else {
    for (int i = 0; i < ans.second.size(); i++) printf("%c", ans.second[i]);
    printf("\n");
  }
  return false;
}
int main() {
  prepare();
  while (solve())
    ;
  return 0;
}