You are given two Strings s and t. All characters of s and t are distinct. No character of s is present in t and no character of t is present in s.
Let N be the length of s, and M be the length of t.
Define a 2-dimensional string array "table" as follows:
- table[i] = s[i-1] (1<=i<=N)
- table[j] = t[j-1] (1<=j<=M)
- table[i][j] = min(table[i-1][j], table[i][j-1]) + max(table[i-1][j], table[i][j-1]) (1<=i<=N, 1<=j<=M)
Note that min and max are defined by the lexicographical order of strings (see Notes for a more formal definition), and A+B means the concatenation of strings A and B.
Your task is to find a substring of table[N][M]. Let L be the length of table[N][M]. Return the substring of table[N][M] whose start position (0-indexed) is pos and length is min(50, L-pos).