Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
str_lis = []
max_str_lis = []
max_num = 1
for i in range(N):
  A = str(input())
  str_lis.append(A)
  times = str_lis.count(A)
  if times > max_num:
    max_str_lis = []
    max_str_lis.append(A)
    max_num = times
  if times == max_num and not A in max_str_lis:
    max_str_lis.append(A)

new_max_str_lis = sorted(max_str_lis)
for i in new_max_str_lis:
  print(i)

Fixed submission:
from collections import Counter

N = int(input())

str_lis = [str(input()) for i in range(N)]
c = Counter(str_lis)
a = c.most_common()
num = a[0][1]
b = []
for i in a:
  if i[1] == num:
    b.append(i[0])
    num = i[1]
  else:
    break
    
new_b = sorted(b)
for i in new_b:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
str_lis = []
max_str_lis = []
max_num = 1
for i in range(N):
  A = str(input())
  str_lis.append(A)
  times = str_lis.count(A)
  if times > max_num:
    max_str_lis = []
    max_str_lis.append(A)
    max_num = times
  if times == max_num and not A in max_str_lis:
    max_str_lis.append(A)

a = []
for i in max_str_lis:
  b = []
  for j in range(len(i)):
    b.append(ord(i[j]))
  a.append(b)
  
new_a = sorted(a)
for i in range(len(new_a)):
  for j in range(len(new_a[i])):
    new_a[i][j] = chr(new_a[i][j])
    
for i in new_a:
  print("".join(i))

Fixed submission:
from collections import Counter

N = int(input())

str_lis = [str(input()) for i in range(N)]
c = Counter(str_lis)
a = c.most_common()
num = a[0][1]
b = []
for i in a:
  if i[1] == num:
    b.append(i[0])
    num = i[1]
  else:
    break
    
new_b = sorted(b)
for i in new_b:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
str_lis = []
for i in range(N):
  A = str(input())
  a = []
  for i in range(len(A)):
    a.append(ord(A[i]))
  str_lis.append(a)

max_num = 0
max_str = []
for i in str_lis:
  if str_lis.count(i) > max_num and not i in max_str:
    max_num = str_lis.count(i)
    max_str = []
    max_str.append(i)
  elif str_lis.count(i) == max_num and not i in max_str:
    max_num = str_lis.count(i)
    max_str.append(i)
    
new_max_str = sorted(max_str)
 
for i in new_max_str:
  for j in range(len(i)):
    i[j] = chr(i[j])

for i in new_max_str:
  print(''.join(i))

Fixed submission:
from collections import Counter

N = int(input())

str_lis = [str(input()) for i in range(N)]
c = Counter(str_lis)
a = c.most_common()
num = a[0][1]
b = []
for i in a:
  if i[1] == num:
    b.append(i[0])
    num = i[1]
  else:
    break
    
new_b = sorted(b)
for i in new_b:
  print(i)

Buggy python submission (verdict: Runtime Error):
N = int(input())
str_lis = []
for i in range(N):
  str_lis.append(ord(input()))

max_num = 0
max_str = []
for i in str_lis:
  if str_lis.count(i) > max_num and not i in max_str:
    max_num = str_lis.count(i)
    max_str = []
    max_str.append(i)
  elif str_lis.count(i) == max_num and not i in max_str:
    max_num = str_lis.count(i)
    max_str.append(i)
    
new_max_str = sorted(max_str)

for i in new_max_str:
  print(chr(i))

Fixed submission:
from collections import Counter

N = int(input())

str_lis = [str(input()) for i in range(N)]
c = Counter(str_lis)
a = c.most_common()
num = a[0][1]
b = []
for i in a:
  if i[1] == num:
    b.append(i[0])
    num = i[1]
  else:
    break
    
new_b = sorted(b)
for i in new_b:
  print(i)