Tiffin Time!
It's lunchtime at UptoSkills Arena! Students bring their favourite tiffins (lunchboxes) to school. Each tiffin has a unique ID. You're given a list of all the tiffin IDs brought to school today. Your task is to find out which tiffin ID is the most common, meaning it appears the most times in the list. If there's a tie for the most common tiffin, output the smallest tiffin ID among those tied.
Input
The first line contains an integer N, the number of tiffins. The second line contains N space-separated integers, the tiffin IDs.
Output
Print a single integer: the ID of the most common tiffin, with ties broken by choosing the smallest ID.
Constraints
1 <= N <= 1000 0 <= tiffin_ID <= 10^9
Example 1
5 10 20 10 30 10
10
Tiffin ID 10 appears 3 times, which is more than any other ID.
Example 2
6 100 200 100 300 200 400
100
Tiffin IDs 100 and 200 both appear twice. Since 100 is smaller than 200, it is chosen.
Hints
# Read the input from stdin and print the answer.
import sys
def main():
data = sys.stdin.read().split()
# your code here
main()
5 10 20 10 30 10
6 100 200 100 300 200 400