Longest Common Substring
Hard
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
n strings are given. Find their common substring of maximum length. It is known that its length is positive.
Input
First line contains the number of strings n (1 ≤ n ≤ 10^5
). Each of the next n strings contains one line of lowercase Latin letters. The total sum of strings' length is no more than 10^5
.
Output
Print the common substring of maximum length.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 7%