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;
char a[55][55];
int d[55][55];
char res[55 * 55], c[55 * 55];
int u[256];
int nr, nc;
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
int n, m;
int ch(int x, int y) { return x >= 0 && y >= 0 && x < n && y < m; }
struct pt {
  int x;
  int y;
  friend int operator<(pt a, pt b) {
    if (a.x != b.x) {
      return a.x < b.x;
    }
    return a.y < b.y;
  }
};
set<pt> ss;
pt p, p1, p2;
queue<pt> q;
pt b[55 * 55 * 5], bb[55 * 55 * 5];
int nb, nbb;
int cmp(char a[55 * 55], char b[55 * 55]) {
  int i;
  for (i = 0; a[i] && b[i]; i++) {
    if (a[i] != b[i]) {
      return a[i] < b[i];
    }
  }
  return 0;
}
int i, j, k, x, y, z, t, t1, mx, c1, c2, c3, c4, bx, by, ex, ey, r, l;
int mn;
int main() {
  scanf("%d%d%d", &n, &m, &mx);
  for (i = 0; i < n; i++) {
    scanf("%s", &a[i]);
    for (j = 0; j < m; j++) {
      if (a[i][j] == 'S') {
        bx = i;
        by = j;
      }
      if (a[i][j] == 'T') {
        ex = i;
        ey = j;
      }
    }
  }
  u['T'] = 1;
  u['S'] = 1;
  for (c1 = 'a'; c1 <= 'z'; c1++) {
    for (c2 = c1; c2 <= 'z'; c2++) {
      for (c3 = c2; c3 <= 'z'; c3++) {
        for (c4 = c3; c4 <= 'z'; c4++) {
          for (i = 'a'; i <= 'z'; i++) {
            u[i] = 0;
          }
          if (mx >= 1) {
            u[c1] = 1;
          }
          if (mx >= 2) {
            u[c2] = 1;
          }
          if (mx >= 3) {
            u[c3] = 1;
          }
          if (mx >= 4) {
            u[c4] = 1;
          }
          for (i = 0; i < n; i++) {
            for (j = 0; j < m; j++) {
              d[i][j] = -1;
            }
          }
          while (!q.empty()) q.pop();
          p.x = ex;
          p.y = ey;
          d[p.x][p.y] = 0;
          q.push(p);
          while (!q.empty()) {
            p = q.front();
            q.pop();
            for (i = 0; i < 4; i++) {
              x = p.x + dx[i];
              y = p.y + dy[i];
              if (ch(x, y) && u[a[x][y]] == 1 && d[x][y] == -1) {
                d[x][y] = d[p.x][p.y] + 1;
                p1.x = x;
                p1.y = y;
                q.push(p1);
              }
            }
          }
          if (d[bx][by] == -1 || (d[bx][by] > nr && nr > 0)) {
            continue;
          }
          p.x = bx;
          p.y = by;
          nb = 0;
          b[nb++] = p;
          nc = d[bx][by];
          for (l = 0; l < nc; l++) {
            nbb = 0;
            mn = 1000000;
            ss.clear();
            for (i = 0; i < nb; i++) {
              for (j = 0; j < 4; j++) {
                x = b[i].x + dx[j];
                y = b[i].y + dy[j];
                if (ch(x, y) && d[x][y] == nc - l - 1) {
                  if (a[x][y] < mn) {
                    mn = a[x][y];
                  }
                }
              }
            }
            for (i = 0; i < nb; i++) {
              for (j = 0; j < 4; j++) {
                x = b[i].x + dx[j];
                y = b[i].y + dy[j];
                if (ch(x, y) && d[x][y] == nc - l - 1 && a[x][y] == mn) {
                  p1.x = x;
                  p1.y = y;
                  if (ss.find(p1) == ss.end()) {
                    bb[nbb++] = p1;
                    ss.insert(p1);
                  }
                }
              }
            }
            for (i = 0; i < nbb; i++) {
              b[i] = bb[i];
            }
            nb = nbb;
            c[l] = mn;
          }
          c[nc] = 0;
          if (nc < nr || nr == 0 || cmp(c, res)) {
            nr = nc;
            for (i = 0; i < nc; i++) {
              res[i] = c[i];
            }
            res[nr] = 0;
          }
          if (mx >= 4) {
            u[c4] = 0;
          }
        }
        if (mx >= 3) {
          u[c3] = 0;
        }
      }
      if (mx >= 2) {
        u[c2] = 0;
      }
    }
    u[c1] = 0;
  }
  if (nr == 0) {
    printf("-1\n");
    return 0;
  } else {
    res[nr - 1] = 0;
    printf("%s\n", res);
  }
  return 0;
}