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
20 10 3
ebebccacdb
eeebccddeT
eadebecaac
adeeeaccbc
baccccdaed
deabceabba
dadbecbaaa
eacbbcedcb
aeeScdbbab
babaecaead
bacdbebeae
aacbadbeec
acddceecca
acaeaebaba
cdddeaaeae
eabddadade
ddddaeaeed
bccbaacadd
dccccbabdc
ecdaebeccc
 1 30 2
bmjcfldkloleiqqiTnmdjpaSckkijf
 15 15 3
cbbdccabdcbacbd
bcabdcacadacdbc
cbcddbbcdbddcad
ddcabdbbdcabbdc
aabadcccTcabdbb
cbacaaacaabdbbd
dbdcbSdabaadbdb
dbbaddcdddaadbb
bbddcdcbaccbbaa
adadadbdbbddccc
cddbbdaddcbbdcc
bbaadcdbbcaacca
adbdcdbbcbddbcd
cdadbcccddcdbda
cbcdaabdcabccbc
 10 8 2
bdcdcbfa
decffcce
dTffdacb
eeedcdbb
fdbbbcba
ddabfcda
abdbSeed
bdcdcffa
cadbaffa
fcccddad
 20 20 2
ddadfcdeTaeccbedeaec
acafdfdeaffdeabdcefe
abbcbefcdbbbcdebafef
fdafdcccbcdeeaedeffc
dfdaabdefdafabaabcef
febdcabacaaaabfacbbe
abfcaacadfdbfdbaaefd
dacceeccddccaccdbbce
cacebecabedbddfbfdad
dacbfcabbebfddcedffd
cfcdfacfadcfbcebebaa
ddfbebafaccbebeefbac
ebfaebacbbebdfcbcbea
dfbaebcfccacfeaccaad
edeedeceebcbfdbcdbbe
afaacccfbdecebfdabed
ddbdcedacedadeccaeec
ecbSeacbdcccbcedafef
cfdbeeffbeeafccfdddb
cefdbdfbabccfdaaadbf
 2 1 4
S
T
 3 5 2
SbcaT
acbab
acccb
 3 4 1
SbbT
aaaa
abba
 5 3 4
aaT
acc
bbb
bbc
cSb
 1 50 3
SaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaTaaaaaaaaaaa
 3 3 1
aaa
aaa
TSa
 6 6 3
pkhipk
mlfmak
aqmbae
dlbfSj
dpbjcr
aTbqbm
 3 4 1
Sbbb
aaaT
abbc
 5 5 1
caTbc
dccac
dacda
aacaS
cdcab
 1 40 1
faSfgfTcfadcdfagfbccbffbeaaebagbfcfcgdfd
 1 3 3
SaT
 1 10 2
baaSaaTacb
 20 20 2
baaaaaaaaaaaaaaaaaaa
bfffffffacfffffffffa
bgggggggaccgggggggga
bhhhhhhhaccchhhhhhha
biiiiiiiacccciiiiiia
bjjjjjjjacccccjjjjja
bkkkkkkkacccccckkkka
blllllllacccccccllla
bbbbbbbbSccccccccmma
bddddddddddcccccccna
bodddddddcccccccccca
bppddddddddTaaaaaaaa
bqqqdddddddbqqqqqqqa
brrrrddddddbrrrrrrra
bsssssdddddbsssssssa
bttttttddddbttttttta
buuuuuuudddbuuuuuuua
bvvvvvvvvddbvvvvvvva
bwwwwwwwwwdbwwwwwwwa
bbbbbbbbbbbbbbbbbbbb
 10 10 2
baaaaaaaaa
bffacffffa
bggaccggga
bbbSccchha
bdddddccia
bjddccccca
bkkdddTaaa
blllddblla
bmmmmdbmma
bbbbbbbbbb
 15 3 4
llv
ttT
hbo
ogc
kfe
gli
fbx
kfp
spm
cxc
ndw
Soa
pfh
edr
xmv
 3 4 2
Sbbb
aabT
abbc
 5 10 4
aaaaaaaaaa
aaaaaTaaaa
aaaaaaaSaa
aaaaaaaaaa
aaaaaaaaaa
 10 20 3
baaaaaaaaaaaaaaaaaaa
bfffffffacfffffffffa
bgggggggaccgggggggga
bbbbbbbbSccchhhhhhha
biiiiidddddcciiiiiia
bjjjjjjddcccccjjjjja
bkkkkkkkdddTaaaaaaaa
bllllllllddbllllllla
bmmmmmmmmmdbmmmmmmma
bbbbbbbbbbbbbbbbbbbb
 1 2 4
ST
 20 10 4
baaaaaaaaa
bffacffffa
bggaccggga
bhhaccchha
biiaccccia
bjjaccccca
bkkakkkkka
bllallllla
bbbSmmmmma
bnnnnnnnna
booooooooa
bpppppTaaa
bqqqqqbqqa
brrrrrbrra
bdddddbssa
btddddbtta
buudddbuua
bvvvddbvva
bwwwwdbwwa
bbbbbbbbbb
 15 10 4
sejwprqjku
pnjsiopxft
rsplgvwixq
endglkchxl
ftihbbexgh
sxtxbbavge
jcdkusfnmr
skgsqvflia
kcxmcxjpae
amaiwcfile
njgjSunmwd
ldxvahgreu
ecmrajbjuT
naioqigols
pbwrmxkltj
 4 5 3
abaaa
babaT
Sabba
aaaaa
 1 2 1
ST
 2 1 1
S
T
 1 20 3
acbccbbddbffScTadffd

bbbcccaccaac
 -1
 aaca
 bbbbee
 -1
 aacccaa
 bb
 bbbc
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 cbqb
 aaa
 -1
 -1
 a
 aa
 ccccc
 ccccc
 -1
 aab
 aa
 ccccc
 mmmno
 aajbju
 aaba
 c

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Collection;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedOutputStream;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.util.ArrayDeque;
import java.util.NoSuchElementException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author An Almost Retired Guy
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt(), m = in.nextInt(), k = in.nextInt();
            CombinatorialEnumerations.Combinations comb = new CombinatorialEnumerations.Combinations(26, k);
            String ans = null;
            char[][] tab = in.nextCharArray2(n, m);
            int sx = -1, sy = -1, tx = -1, ty = -1;
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++) {
                    if (tab[i][j] == 'S') {
                        sx = i;
                        sy = j;
                    } else if (tab[i][j] == 'T') {
                        tx = i;
                        ty = j;
                    }
                }
            boolean[][] valid = new boolean[n][m];
            boolean[] can = new boolean[26];
            for (int i = 0; i < comb.totalCount(); i++) {
                int[] arr = comb.fromNumber(i);
                for (boolean[] aux : valid) Arrays.fill(aux, false);
                Arrays.fill(can, false);
                for (int x : arr) can[x] = true;
                for (int j = 0; j < n; j++)
                    for (int l = 0; l < m; l++)
                        if (tab[j][l] == 'S' || tab[j][l] == 'T' || can[tab[j][l] - 'a']) valid[j][l] = true;
                String aux = solve(tab, valid, sx, sy, tx, ty);
                if (ans == null || (aux != null && (aux.length() < ans.length() || (aux.length() == ans.length() && aux.compareTo(ans) == -1))))
                    ans = aux;
            }
            if (ans == null) out.println(-1);
            else out.println(ans);
        }

        String solve(char[][] tab, boolean[][] valid, int sx, int sy, int tx, int ty) {
            int n = tab.length, m = tab[0].length;
            int[][] preX = new int[n][m], preY = new int[n][m], dist = new int[n][m];
            for (int[] arr : dist) Arrays.fill(arr, Integer.MAX_VALUE);
            ArrayDeque<EzIntIntPair> queue = new ArrayDeque<>();
            queue.add(new EzIntIntPair(sx, sy));
            final int[] dx = new int[]{-1, 0, 0, 1}, dy = new int[]{0, -1, 1, 0};
            while (!queue.isEmpty()) {
                EzIntIntPair pair = queue.removeFirst();
                int x = pair.first, y = pair.second;
                for (int i = 0; i < 4; i++) {
                    int x2 = x + dx[i], y2 = y + dy[i];
                    if (x2 >= 0 && x2 < n && y2 >= 0 && y2 < m && valid[x2][y2]) {
                        if (dist[x2][y2] > dist[x][y] + 1) {
                            dist[x2][y2] = dist[x][y] + 1;
                            queue.addLast(new EzIntIntPair(x2, y2));
                            preX[x2][y2] = x;
                            preY[x2][y2] = y;
                        } else if (dist[x2][y2] == dist[x][y] + 1 && tab[x][y] < tab[preX[x2][y2]][preY[x2][y2]]) {
                            preX[x2][y2] = x;
                            preY[x2][y2] = y;
                        }
                    }
                }
            }
            if (dist[tx][ty] == Integer.MAX_VALUE) return null;
            EzCharArrayDeque stack = new EzCharArrayDeque();
            for (int x = preX[tx][ty], y = preY[tx][ty]; tab[x][y] != 'S'; ) {
                stack.addFirst(tab[x][y]);
                if (stack.size() > n * m) {
                    return null;
                }
                int nx = preX[x][y], ny = preY[x][y];
                x = nx;
                y = ny;
            }
            return new String(stack.toArray());
        }

    }

    static interface EzCharList extends EzCharCollection {
        int size();

        EzCharIterator iterator();

        boolean equals(Object object);

        int hashCode();

        String toString();

    }

    static final class PrimitiveHashCalculator {
        private PrimitiveHashCalculator() {
        }

        public static int getHash(char x) {
            return x;
        }

        public static int getHash(int x) {
            return x;
        }

    }

    static class InputReader {
        BufferedReader br;
        StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String next() {
            while (st == null || !st.hasMoreElements()) {
                st = new StringTokenizer(nextLine());
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextString() {
            return next();
        }

        public char[] nextCharArray(int n) {
            char[] a = nextString().toCharArray();
            assert (a.length == n);
            return a;
        }

        public char[][] nextCharArray2(int n, int m) {
            char[][] a = new char[n][];
            for (int i = 0; i < n; i++) a[i] = nextCharArray(m);
            return a;
        }

        public String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

    }

    static interface EzCharCollection {
        int size();

        EzCharIterator iterator();

        boolean equals(Object object);

        int hashCode();

        String toString();

    }

    static class EzIntIntPair implements Comparable<EzIntIntPair> {
        private static final int HASHCODE_INITIAL_VALUE = 0x811c9dc5;
        private static final int HASHCODE_MULTIPLIER = 0x01000193;
        public final int first;
        public final int second;

        public EzIntIntPair(int first, int second) {
            this.first = first;
            this.second = second;
        }


        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            EzIntIntPair that = (EzIntIntPair) o;

            return first == that.first && second == that.second;
        }


        public int hashCode() {
            int hash = HASHCODE_INITIAL_VALUE;
            hash = (hash ^ PrimitiveHashCalculator.getHash(first)) * HASHCODE_MULTIPLIER;
            hash = (hash ^ PrimitiveHashCalculator.getHash(second)) * HASHCODE_MULTIPLIER;
            return hash;
        }


        public int compareTo(EzIntIntPair other) {
            int cmpU = Integer.compare(first, other.first);
            return cmpU != 0 ? cmpU : Integer.compare(second, other.second);
        }


        public String toString() {
            return "(" + first + ", " + second + ")";
        }

    }

    static class EzCharArrayDeque implements EzCharDeque, EzCharList {
        private static final int DEFAULT_CAPACITY = 8;
        private static final int HASHCODE_INITIAL_VALUE = 0x811c9dc5;
        private static final int HASHCODE_MULTIPLIER = 0x01000193;
        private char[] deque;
        private int size;
        private int head;
        private int tail;
        private int mask;

        public EzCharArrayDeque() {
            this(DEFAULT_CAPACITY);
        }

        public EzCharArrayDeque(int capacity) {
            if (capacity < 0) {
                throw new IllegalArgumentException("Capacity must be non-negative");
            }
            if (capacity < 1) {
                capacity = 1;
            }
            if ((capacity & (capacity - 1)) != 0) {
                capacity = Integer.highestOneBit(capacity) << 1;
            }
            // Capacity is a power of 2 now
            deque = new char[capacity];
            size = 0;
            head = 0;
            tail = 0;
            mask = deque.length - 1;
        }

        public EzCharArrayDeque(EzCharCollection collection) {
            this(collection.size() + 1);
            for (EzCharIterator iterator = collection.iterator(); iterator.hasNext(); ) {
                deque[tail++] = iterator.next();
            }
            size = collection.size();
        }

        public EzCharArrayDeque(char[] srcArray) {
            this(srcArray.length + 1);
            System.arraycopy(srcArray, 0, deque, 0, srcArray.length);
            tail = srcArray.length;
            size = srcArray.length;
        }

        public EzCharArrayDeque(Collection<Character> javaCollection) {
            this(javaCollection.size() + 1);
            for (char element : javaCollection) {
                deque[tail++] = element;
            }
            size = javaCollection.size();
        }


        public int size() {
            return size;
        }


        public EzCharIterator iterator() {
            return new EzCharArrayDequeIterator();
        }


        public char[] toArray() {
            char[] result = new char[size];
            for (int i = head, j = 0; i != tail; i = (i + 1) & mask) {
                result[j++] = deque[i];
            }
            return result;
        }


        public void addFirst(char element) {
            head = (head - 1) & mask;
            deque[head] = element;
            size++;
            if (size == deque.length) {
                enlarge();
            }
        }

        private void enlarge() {
            int newSize = (size << 1);
            char[] newArray = new char[newSize];
            System.arraycopy(deque, head, newArray, 0, deque.length - head);
            System.arraycopy(deque, 0, newArray, deque.length - tail, tail);
            deque = newArray;
            head = 0;
            tail = size;
            mask = deque.length - 1;
        }


        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            EzCharArrayDeque that = (EzCharArrayDeque) o;

            if (size != that.size) {
                return false;
            }
            for (int i = head, j = that.head; i != tail; i = (i + 1) & mask, j = (j + 1) & that.mask) {
                if (deque[i] != that.deque[j]) {
                    return false;
                }
            }
            return true;
        }


        public int hashCode() {
            int hash = HASHCODE_INITIAL_VALUE;
            for (int i = head; i != tail; i = (i + 1) & mask) {
                hash = (hash ^ PrimitiveHashCalculator.getHash(deque[i])) * HASHCODE_MULTIPLIER;
            }
            return hash;
        }


        public String toString() {
            StringBuilder sb = new StringBuilder();
            sb.append('[');
            for (int i = head; i != tail; i = (i + 1) & mask) {
                if (i != head) {
                    sb.append(", ");
                }
                sb.append(deque[i]);
            }
            sb.append(']');
            return sb.toString();
        }

        private class EzCharArrayDequeIterator implements EzCharIterator {
            private int curIndex = head;


            public boolean hasNext() {
                return curIndex != tail;
            }


            public char next() {
                if (curIndex == tail) {
                    throw new NoSuchElementException("Iterator doesn't have more elements");
                }
                final char result = deque[curIndex];
                curIndex = (curIndex + 1) & mask;
                return result;
            }

        }

    }

    static interface EzCharStack extends EzCharCollection {
        int size();

        EzCharIterator iterator();

        boolean equals(Object object);

        int hashCode();

        String toString();

    }

    static interface EzCharIterator {
        boolean hasNext();

        char next();

    }

    static interface EzCharQueue extends EzCharCollection {
        int size();

        EzCharIterator iterator();

        boolean equals(Object object);

        int hashCode();

        String toString();

    }

    static interface EzCharDeque extends EzCharQueue, EzCharStack {
        int size();

        EzCharIterator iterator();

        boolean equals(Object object);

        int hashCode();

        String toString();

    }

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(new BufferedOutputStream(outputStream));
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public void close() {
            super.close();
        }

    }

    static class CombinatorialEnumerations {
        public static abstract class AbstractEnumeration {
            protected final int range;
            protected final int length;

            protected AbstractEnumeration(int range, int length) {
                this.range = range;
                this.length = length;
            }

            protected abstract long count(int[] prefix);

            public long totalCount() {
                return count(new int[0]);
            }

            public int[] fromNumber(long number) {
                int[] sequence = new int[length];
                for (int i = 0; i < sequence.length; i++) {
                    int[] prefix = Arrays.copyOf(sequence, i + 1);
                    for (prefix[i] = 0; prefix[i] < range; ++prefix[i]) {
                        long cur = count(prefix);
                        if (number < cur) {
                            break;
                        }
                        number -= cur;
                    }
                    sequence[i] = prefix[i];
                }
                return sequence;
            }

        }

        public static class Combinations extends CombinatorialEnumerations.AbstractEnumeration {
            final long[][] binomial;

            public Combinations(int n, int k) {
                super(n, k);
                binomial = new long[n + 1][n + 1];
                // calculate binomial coefficients in advance
                for (int i = 0; i <= n; i++)
                    for (int j = 0; j <= i; j++)
                        binomial[i][j] = (j == 0) ? 1 : binomial[i - 1][j - 1] + binomial[i - 1][j];
            }


            protected long count(int[] prefix) {
                int size = prefix.length;

                // if there is no combination with given prefix, 0 must be returned.
                // by contract only the last element can make prefix invalid.
                if (size >= 2 && prefix[size - 1] <= prefix[size - 2])
                    return 0;

                // prefix is valid. return the number of combinations starting with prefix
                int last = size > 0 ? prefix[size - 1] : -1;
                return binomial[range - 1 - last][length - size];
            }

        }

    }
}

