a=[0]*1001 for _ in range(int(input())): a[len(input())-2]+=1 x=0;y=0 for i in range(1000,-1,-1): if y