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 JAVA):

Solution:
import java.io.*;
import java.util.*;

public class CF84E {
	static class P {
		boolean visited;
		P p;
		int i, j;
		P(int i, int j) {
			this.i = i;
			this.j = j;
		}
	}
	static int n, m, k, is, js, it, jt;
	static char[][] aa;
	static String s;
	static P separator = new P(-1, -1);
	static P[][] pp, qq;
	static int[] ll;
	static String trace(P p) {
		return p.p == null ? "" : trace(p.p) + aa[p.i][p.j];
	}
	static void update(P p) {
		String t = trace(p);
		if (s == null)
			s = t;
		else {
			int ls = s.length(), lt = t.length();
			if (ls > lt || ls == lt && s.compareTo(t) > 0)
				s = t;
		}
	}
	static void bfs(char[] cc) {
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++) {
				P p = pp[i][j];
				p.visited = false;
				p.p = null;
			}
		LinkedList<P> queue = new LinkedList<>();
		pp[is][js].visited = true;
		queue.addLast(pp[is][js]);
		queue.addLast(separator);
		P p, q;
		while (!queue.isEmpty()) {
			for (int c = 0; c < k; c++)
				ll[c] = 0;
			while ((p = queue.removeFirst()) != separator) {
				int[] ii = { p.i - 1, p.i + 1, p.i, p.i };
				int[] jj = { p.j, p.j, p.j - 1, p.j + 1 };
				for (int h = 0; h < 4; h++) {
					int i = ii[h];
					int j = jj[h];
					if (i == it && j == jt) {
						update(p);
						return;
					}
					if (i < 0 || i >= n || j < 0 || j >= m)
						continue;
					q = pp[i][j];
					if (!q.visited) {
						q.visited = true;
						for (int c = 0; c < k; c++)
							if (aa[i][j] == cc[c]) {
								q.p = p;
								qq[c][ll[c]++] = q;
								break;
							}
					}
				}
			}
			for (int c = 0; c < k; c++)
				if (ll[c] > 0) {
					for (int l = 0; l < ll[c]; l++)
						queue.addLast(qq[c][l]);
					queue.addLast(separator);
				}
		}
	}
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		n = Integer.parseInt(st.nextToken());
		m = Integer.parseInt(st.nextToken());
		k = Integer.parseInt(st.nextToken());
		aa = new char[n][m];
		for (int i = 0; i < n; i++)
			br.readLine().getChars(0, m, aa[i], 0);
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++)
				if (aa[i][j] == 'S') {
					is = i;
					js = j;
				} else if (aa[i][j] == 'T') {
					it = i;
					jt = j;
				}
		pp = new P[n][m];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++)
				pp[i][j] = new P(i, j);
		qq = new P[k][n * m];
		ll = new int[k];
		char[] cc = new char[k];
		for (char a = 'a'; a <= 'z'; a++) {
			cc[0] = a;
			if (k == 1) {
				bfs(cc);
				continue;
			}
			for (char b = (char) (a + 1); b <= 'z'; b++) {
				cc[1] = b;
				if (k == 2) {
					bfs(cc);
					continue;
				}
				for (char c = (char) (b + 1); c <= 'z'; c++) {
					cc[2] = c;
					if (k == 3) {
						bfs(cc);
						continue;
					}
					for (char d = (char) (c + 1); d <= 'z'; d++) {
						cc[3] = d;
						bfs(cc);
					}
				}
			}
		}
		System.out.println(s == null ? -1 : s);
	}
}