A phone's autocomplete suggests the longest beginning shared by all the words you've typed before.
Given n words, find their longest common prefix. If they share no common beginning, print None.
Input Format
The first line has n.
Each of the next n lines has one lowercase word.
Output Format
Print the longest common prefix, or None.
Constraints
• 1 ≤ n ≤ 200
• 1 ≤ word length ≤ 200
Examples
Example 1
Input
3
flower
flow
flight
Output
fl
Explanation All three start with fl.
Example 2
Input
3
dog
racecar
car
Output
None
Explanation No common first letter.
Example 3
Input
1
bashabyte
Output
bashabyte
Explanation With one word, the whole word is the prefix.
Acceptance
—
Accepted
0
Submissions
0