CodeLab Academy 📞 9936 6696
← List Python · Level 7: Lists Code · 70 points ← #621 #623 →

#622. The most frequent value (if there is a tie, the smaller one)

You are given a list of integers. **The most frequent value (if there is a tie, the smaller one)**. If there is no second value, print `None`. If the answer has several numbers, separate them with spaces. ### Input The first line has n, the second line has n integers separated by spaces. ### Output The answer.

Examples

Input
4
-5 -14 20 20
Output
20
Input
10
-12 -2 -2 -10 18 -12 -9 -20 15 -20
Output
-20

💡 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!