Two strings consisting of and are given. Consider all substrings that are common to both given strings. Find the -th such substring in lexicographical order.
A string is lexicographically smaller than a string if one of the following holds:
is a prefix of ;
there exists an index (no greater than the lengths of and ) such that for all j < i, S[j] = T[j] and S[i] < T[i].
The first two lines contain the given strings, each of length at most . The third line contains a positive integer that does not exceed the number of common substrings of the two given strings.
Output the -th common substring of the given strings in lexicographical order.
Example 1