Buggy python submission (verdict: Runtime Error):
n = int(input())
d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1
m = d[max(d)]
l=[]
for i in d:
    if d[i] == m:
        l.append(i)
for i in sorted(l):
    print(i)

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

Buggy python submission (verdict: Runtime Error):
d = {}
for i in range(n):
    if s[i] in d:
        d[s[i]] += 1
    else:
        d[s[i]] = 1
m = d[max(d)]
l=[]
for i in d:
    if d[i] == m:
        l.append(i)
for i in sorted(l):
    print(i)

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input() for _ in range(n))
ss = sorted(list(set(s)))
lens = len(ss)
l = [0]*lens
for i in range(n):
        l[ss.index(s[i])] += 1
for i in range(lens):
    if l[i] == max(l):
        print(ss[i])

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input() for _ in range(n))
ss = sorted(list(set(s)))
lens = len(ss)
l = [0]*lens
for i in range(lens):
    l[i] = s.count(ss[i])
for i in range(lens):
    if l[i] == max(l):
        print(ss[i])

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input() for _ in range(n))
ss = sorted(list(set(s)))
lens = len(ss)
l = [0]*len(ss)
for i in range(lens):
    l[i] =s.count(ss[i])
for i in range(lens):
    if l[i] == max(l):
        print(ss[i])

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

Buggy python submission (verdict: Runtime Error):
ss = sorted(list(set(s)))
lens = len(ss)
l = [0]*len(ss)
for i in range(lens):
    l[i] =s.count(ss[i])
for i in range(lens):
    if l[i] == max(l):
        print(ss[i])

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(input() for _ in range(n))
ss = sorted(list(set(s)))
l = [0]*len(ss)
for i in range(len(ss)):
    l[i] =s.count(ss[i])
for i in range(len(ss)):
    if l[i] == max(l):
        print(ss[i])

Fixed submission:
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)