Substrings-3#5094

Substrings-3

1 second
64 megabytes
Medium

Given strings of lowercase Latin letters, your task is to determine their longest common substring.

Input

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

Output

Output the longest common substring shared by all strings.

Examples

Example 1

Loading
Loading