Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

def main():
  num = int(input())

  tmp = [input() for i in range(num)]

  count = Counter(tmp)

  tmp2 = [k for k, v in count.items() if count.most_common(1)[0][1] == v]

  for t in sorted(tmp2):
    print(t)

main()

Fixed submission:
def main():
  num = int(input())

  tmp = [input() for i in range(num)]

  tmp2 = {}
  for t in tmp:
    if len(tmp2) == 0:
      tmp2[t] = 1
    else:
      if t in tmp2:
        tmp2[t] += 1
      else:
        tmp2[t] = 1

  _tmp2 = sorted(tmp2.items(), key=lambda x:x[1])
  tmp3 = sorted(tmp2.items())
  for t in tmp3:
    if _tmp2[-1][1] == t[1]:
      print(t[0])

main()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

num = int(input())

tmp = [input() for i in range(num)]

count = Counter(tmp)

tmp2 = [k for k, v in count.items() if count.most_common(1)[0][1] == v]

for t in sorted(tmp2):
  print(t)

Fixed submission:
def main():
  num = int(input())

  tmp = [input() for i in range(num)]

  tmp2 = {}
  for t in tmp:
    if len(tmp2) == 0:
      tmp2[t] = 1
    else:
      if t in tmp2:
        tmp2[t] += 1
      else:
        tmp2[t] = 1

  _tmp2 = sorted(tmp2.items(), key=lambda x:x[1])
  tmp3 = sorted(tmp2.items())
  for t in tmp3:
    if _tmp2[-1][1] == t[1]:
      print(t[0])

main()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

num = int(input())

# tmp = []
# for n in range(num):
#   tmp.append(input())

tmp = [input() for i in range(num)]

count = Counter(tmp)

tmp2 = []
for k, v in count.items():
  if count.most_common(1)[0][1] == v:
    tmp2.append(k)

for t in sorted(tmp2):
  print(t)

Fixed submission:
def main():
  num = int(input())

  tmp = [input() for i in range(num)]

  tmp2 = {}
  for t in tmp:
    if len(tmp2) == 0:
      tmp2[t] = 1
    else:
      if t in tmp2:
        tmp2[t] += 1
      else:
        tmp2[t] = 1

  _tmp2 = sorted(tmp2.items(), key=lambda x:x[1])
  tmp3 = sorted(tmp2.items())
  for t in tmp3:
    if _tmp2[-1][1] == t[1]:
      print(t[0])

main()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

num = int(input())

# tmp = []
# for n in range(num):
#   tmp.append(input())

tmp = [input() for i in range(num)]

count = Counter(tmp)

tmp2 = []
for k, v in count.items():
  if count.most_common(1)[0][1] == v:
    tmp2.append(k)

for t in sorted(tmp2):
  print(t)
  

Fixed submission:
def main():
  num = int(input())

  tmp = [input() for i in range(num)]

  tmp2 = {}
  for t in tmp:
    if len(tmp2) == 0:
      tmp2[t] = 1
    else:
      if t in tmp2:
        tmp2[t] += 1
      else:
        tmp2[t] = 1

  _tmp2 = sorted(tmp2.items(), key=lambda x:x[1])
  tmp3 = sorted(tmp2.items())
  for t in tmp3:
    if _tmp2[-1][1] == t[1]:
      print(t[0])

main()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

num = int(input())

tmp = []
for n in range(num):
  tmp.append(input())

count = Counter(tmp)

tmp2 = []
for k, v in count.items():
  if count.most_common(1)[0][1] == v:
    tmp2.append(k)

for t in sorted(tmp2):
  print(t)
  

Fixed submission:
def main():
  num = int(input())

  tmp = [input() for i in range(num)]

  tmp2 = {}
  for t in tmp:
    if len(tmp2) == 0:
      tmp2[t] = 1
    else:
      if t in tmp2:
        tmp2[t] += 1
      else:
        tmp2[t] = 1

  _tmp2 = sorted(tmp2.items(), key=lambda x:x[1])
  tmp3 = sorted(tmp2.items())
  for t in tmp3:
    if _tmp2[-1][1] == t[1]:
      print(t[0])

main()