Substrings-3
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Given K rows of lowercase Latin letters, your task is to determine their longest common substring.
Input
The first line contains the integer K (1 ≤ K ≤ 10). The following K lines each contain a row of lowercase Latin letters, with each row having a length between 1 and 10000.
Output
Output the longest common substring shared by all K rows.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 21%