Many lines
Hard
Execution time limit is 2 seconds
Runtime memory usage limit is 256 megabytes
Given K rows of lowercase Latin letters, your task is to identify the longest common substring among them.
Input
The first line contains the integer K (1 ≤ K ≤ 10). The following K lines each contain one row of lowercase Latin letters, with each row having a length between 1 and 10000.
Output
Output the longest common substring shared by all the rows.
Examples
Input #1
Answer #1
Submissions 224
Acceptance rate 10%