Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
for i in words.keys():
  if words[i] == max(words.values()):
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

Fixed submission:
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
Max = max(words.values())
for i in words.keys():
  if words[i] == Max:
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

Buggy python submission (verdict: Runtime Error):
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
for i in res_dict.keys():
  if res_dict[i] == max(res_dict.values()):
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

Fixed submission:
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
Max = max(words.values())
for i in words.keys():
  if words[i] == Max:
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

Buggy python submission (verdict: Runtime Error):
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  else:
    words[name] += 1
    
res_name = []
for i in res_dict.keys():
  if res_dict[i] == max(res_dict.values()):
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

Fixed submission:
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
Max = max(words.values())
for i in words.keys():
  if words[i] == Max:
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
names = list()
for i in range(N):
  names.append(input())
res_dict = dict()
for i in names:
  count = names.count(i)
  res_dict[i] = count
res_name = []
for i in res_dict.keys():
  if res_dict[i] == max(res_dict.values()):
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

Fixed submission:
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
Max = max(words.values())
for i in words.keys():
  if words[i] == Max:
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
names = []
words = {}
for i in range(N):
    name = input()
    if name in names:
      words[name] += 1
    else:
      words[name] = 1
      names.append(name)
        
        
max_name_list = []
for nm in words.items():
    if nm[1] == max(words.values()):
        max_name_list.append(nm[0])
max_name_list = sorted(max_name_list)
for i in range(len(max_name_list)):
    print(max_name_list[i])


Fixed submission:
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
Max = max(words.values())
for i in words.keys():
  if words[i] == Max:
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
names = []
words = {}
for i in range(N):
    name = input()
    if name not in names:
        words[name] = 1
        names.append(name)
    elif name in names:
        words[name] += 1
        
max_name_list = []
for nm in words.items():
    if nm[1] == max(words.values()):
        max_name_list.append(nm[0])
max_name_list = sorted(max_name_list)
for i in range(len(max_name_list)):
    print(max_name_list[i])

Fixed submission:
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
Max = max(words.values())
for i in words.keys():
  if words[i] == Max:
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
names = []
words = {}
for i in range(N):
  name = input()
  if name not in names:
    words[name] = 1
    names.append(name)
  elif name in names:
    words[name] += 1
        
max_name_list = [nm[0] for nm in words.items() if nm[1] == max(words.values())]
max_name_list = sorted(max_name_list)

for i in range(len(max_name_list)):
  print(max_name_list[i])


Fixed submission:
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
Max = max(words.values())
for i in words.keys():
  if words[i] == Max:
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
names = []
words = {}
for i in range(N):
    name = input()
    if name not in names:
        words[name] = 1
        names.append(name)
    elif name in names:
        words[name] += 1
        
max_name_list = [nm[0] for nm in words.items() if nm[1] == max(words.values())]
max_name_list = sorted(max_name_list)

for i in range(len(max_name_list)):
    print(max_name_list[i])

Fixed submission:
N = int(input())
words = {}
for i in range(N):
  name = input()
  if name not in words:
    words[name] = 1
  elif name in words:
    words[name] += 1
    
res_name = []
Max = max(words.values())
for i in words.keys():
  if words[i] == Max:
    res_name.append(i)
res_name = sorted(res_name)
for i in res_name:
  print(i)