LearnPy Hub
← Arena
EasyRating 1000

Common Prefix

Print the longest common prefix of all the words, or - if there is none.

Input

n, then n words.

Output

The prefix.

Sample 1

Input
3
flower
flow
flight
Output
fl

Sample 2

Input
2
dog
car
Output
-
solution.py
Output appears here
Common Prefix · Python Arena problem · LearnPy Hub