Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b=list(set(a))
b.sort()
c=list(map(lambda x:a.count(x),b))
d=int(c.count(max(c)))
e=[]
for k in range(d):
  e.append(b[c.index(max(c))])
  c[c.index(max(c))]=0
for l in e:
  print(l)

Fixed submission:
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b={}
for j in range(len(a)):
  if a[j] in b:
    b[a[j]]+=1
  else:
    b[a[j]]=1
max_b=max(b.values())
c=[]
for k,l in b.items():
  if l==max_b:
    c.append(k)
c.sort()
for m in c:
  print(m)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b=list(set(a))
c=list(map(lambda x:a.count(x),b))
d=int(c.count(max(c)))
e=[]
for k in range(d):
  e.append(b[c.index(max(c))])
  c[c.index(max(c))]=0
for l in range(len(e)):
  print(min(e))
  e.remove(min(e))

Fixed submission:
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b={}
for j in range(len(a)):
  if a[j] in b:
    b[a[j]]+=1
  else:
    b[a[j]]=1
max_b=max(b.values())
c=[]
for k,l in b.items():
  if l==max_b:
    c.append(k)
c.sort()
for m in c:
  print(m)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b=list(set(a))
c=[]
for j in range(len(b)):
  c.append(a.count(b[j]))
d=int(c.count(max(c)))
e=[]
for k in range(d):
  e.append(b[c.index(max(c))])
  c[c.index(max(c))]=0
for l in range(len(e)):
  print(min(e))
  e.remove(min(e))

Fixed submission:
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b={}
for j in range(len(a)):
  if a[j] in b:
    b[a[j]]+=1
  else:
    b[a[j]]=1
max_b=max(b.values())
c=[]
for k,l in b.items():
  if l==max_b:
    c.append(k)
c.sort()
for m in c:
  print(m)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b=list(set(a))
c=[]
for j in range(len(b)):
  c.append(a.count(b[j]))
d=int(c.count(max(c)))
while True:
  if len(b)==0:
    break
  elif a.count(min(b))==max(c):
    print(min(b))
    b.remove(min(b))
  else:
    b.remove(min(b))

Fixed submission:
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b={}
for j in range(len(a)):
  if a[j] in b:
    b[a[j]]+=1
  else:
    b[a[j]]=1
max_b=max(b.values())
c=[]
for k,l in b.items():
  if l==max_b:
    c.append(k)
c.sort()
for m in c:
  print(m)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b=[]
for j in range(len(a)):
  b.append(a.count(a[j]))
c=int(b.count(max(b))/max(b))
d=[]
for k in range(c):
  d.append(a[b.index(max(b))])
  a.remove(d[k])
for l in range(len(d)):
  print(min(d))
  d.remove(min(d))

Fixed submission:
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b={}
for j in range(len(a)):
  if a[j] in b:
    b[a[j]]+=1
  else:
    b[a[j]]=1
max_b=max(b.values())
c=[]
for k,l in b.items():
  if l==max_b:
    c.append(k)
c.sort()
for m in c:
  print(m)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b=[]
for j in range(len(a)):
  b.append(a.count(a[j]))
c=int(b.count(max(b))/max(b))
d=[]
for k in range(c):
  d.append(a[b.index(max(b))])
  a.remove(d[k])
e=[]
for l in range(len(d)):
  e.append(min(d))
  d.remove(e[l])
for m in e:
  print(m)

Fixed submission:
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b={}
for j in range(len(a)):
  if a[j] in b:
    b[a[j]]+=1
  else:
    b[a[j]]=1
max_b=max(b.values())
c=[]
for k,l in b.items():
  if l==max_b:
    c.append(k)
c.sort()
for m in c:
  print(m)