CodeLab Academy 📞 9936 6696
← List Python · Level 10: Algorithms Code · 100 points ← #967 #969 →

#968. Longest common prefix

You get n words. Print the longest prefix that all of them share. If there is none, print `None`. ### Input n, then n lines with a word. ### Output One line.

Examples

Input
3
yz
vaq
variayz
Output
None
Input
3
ryz
robotyz
robotx
Output
r

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!