Common Substring (Easy)
Given two strings composed of the characters 0 and 1, identify all substrings that are common to both strings. Your task is to determine the k-th substring in lexicographical order.
A string S is considered lexicographically smaller than a string T if one of the following conditions is true:
S is a prefix of T.
There exists an index i, not exceeding the lengths of S and T, such that for all indices j less than i, S[j] equals T[j], and S[i] is less than T[i].
Input
The input consists of two lines, each containing one of the given strings, with a maximum length of 100 characters. The third line contains a positive integer k, which does not exceed the total number of common substrings between the two strings.
Output
Print the k-th common substring of the two strings in lexicographical order.