Buggy python submission (verdict: Time Limit Exceeded):
from bisect import insort_left
from sys import stdin

def main():
    input = stdin.readline
    n = int(input())
    
    d = {}
    ds = d.setdefault
    m = 1
    for i in range(n):
        s = input().rstrip()
        ds(s, 0)
        d[s] += 1
        if m < d[s]:
            m = d[s]
    
    l = []
    for i, j in d.items():
        if j == m:
            insort_left(l, i)
            
    print("\n".join(l))

if __name__ == "__main__":
    main()

Fixed submission:
from collections import Counter

n = int(input())

l = [input() for i in range(n)]

c = Counter(l)

ml = c.most_common()
mc = ml[0][1]

ml.sort()

for i in ml:
    if i[1] == mc:
        print(i[0])

Buggy python submission (verdict: Time Limit Exceeded):
from bisect import insort_left
from sys import stdin

def main():
    input = stdin.readline
    n = int(input())
    
    d = {}
    ds = d.setdefault
    m = 1
    for i in range(n):
        s = input().rstrip()
        ds(s, 0)
        d[s] += 1
        if m < d[s]:
            m = d[s]
    
    l = []
    for i, j in d.items():
        if j == m:
            insort_left(l, i)
            
    print("\n".join(l))

if __name__ == "__main__":
    main()

Fixed submission:
from collections import Counter

n = int(input())

l = [input() for i in range(n)]

c = Counter(l)

ml = c.most_common()
mc = ml[0][1]

ml.sort()

for i in ml:
    if i[1] == mc:
        print(i[0])

Buggy python submission (verdict: Time Limit Exceeded):
from bisect import insort_left
from sys import stdin

input = stdin.readline
n = int(input())

d = {}
m = 1
for i in range(n):
    s = input().rstrip()
    d.setdefault(s, 0)
    d[s] += 1
    if m < d[s]:
        m = d[s]

l = []
for i, j in d.items():
    if j == m:
        insort_left(l, i)
        
print("\n".join(l))


Fixed submission:
from collections import Counter

n = int(input())

l = [input() for i in range(n)]

c = Counter(l)

ml = c.most_common()
mc = ml[0][1]

ml.sort()

for i in ml:
    if i[1] == mc:
        print(i[0])

Buggy python submission (verdict: Time Limit Exceeded):
from bisect import insort_left
from sys import stdin

input = stdin.readline
n = int(input())

d = {}
m = 1
for i in range(n):
    s = input().rstrip()
    d.setdefault(s, 0)
    d[s] += 1
    if m < d[s]:
        m = d[s]

l = []
for i, j in d.items():
    if j == m:
        insort_left(l, i)
        
print("\n".join(l))


Fixed submission:
from collections import Counter

n = int(input())

l = [input() for i in range(n)]

c = Counter(l)

ml = c.most_common()
mc = ml[0][1]

ml.sort()

for i in ml:
    if i[1] == mc:
        print(i[0])

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = int(input())

d = {}
m = 1
for i in range(n):
    s = input()
    d.setdefault(s, 0)
    d[s] += 1
    if m < d[s]:
        m = d[s]

l = []
for i, j in d.items():
    if j == m:
        bisect.insort_left(l, i)
        
print("\n".join(l))


Fixed submission:
from collections import Counter

n = int(input())

l = [input() for i in range(n)]

c = Counter(l)

ml = c.most_common()
mc = ml[0][1]

ml.sort()

for i in ml:
    if i[1] == mc:
        print(i[0])

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = int(input())

d = {}
m = 1
for i in range(n):
    s = input()
    d.setdefault(s, 0)
    d[s] += 1
    if m < d[s]:
        m = d[s]

l = []
for i, j in d.items():
    if j == m:
        bisect.insort_left(l, i)
        
for i in l:
    print(i)


Fixed submission:
from collections import Counter

n = int(input())

l = [input() for i in range(n)]

c = Counter(l)

ml = c.most_common()
mc = ml[0][1]

ml.sort()

for i in ml:
    if i[1] == mc:
        print(i[0])

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = int(input())

d = {}
m = 1
for i in range(n):
    s = input()
    if s in d:
        d[s] += 1
        if m < d[s]:
            m = d[s]
    else:
        d[s] = 1

l = []
for i in d:
    if d[i] == m:
        bisect.insort_left(l, i)
        
for i in l:
    print(i)

Fixed submission:
from collections import Counter

n = int(input())

l = [input() for i in range(n)]

c = Counter(l)

ml = c.most_common()
mc = ml[0][1]

ml.sort()

for i in ml:
    if i[1] == mc:
        print(i[0])