Many lines#4160

Many lines

2 seconds
256 megabytes
Hard (≈1650)

Given rows of lowercase Latin letters, your task is to identify the longest common substring among them.

Input

The first line contains the integer (1 \le K \le 10). The following lines each contain one row of lowercase Latin letters, with each row having a length between and .

Output

Output the longest common substring shared by all the rows.

Examples

Example 1

Loading
Loading