Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from collections import Counter
def main():
    N = int(input())
    S = [str(input()) for i in range(N)]
    c = Counter(S)
    ans = []
    tmp = []
    tmp = c.most_common()
    cmax = c.most_common()[0][1]
    for i in range(N):
        if tmp[i][1] != cmax:
            break
        ans.append(tmp[i][0])
    ans.sort()
    print('\n'.join(ans))
if __name__ == '__main__':
    main()

Fixed submission:
# -*- coding: utf-8 -*-
from collections import Counter
def main():
    N = int(input())
    S = [input() for i in range(N)]
    c = Counter(S)
    ans = []
    tmp = []
    tmp = c.most_common()
    cmax = c.most_common()[0][1]
    ans = [k for k , j in c.items() if j == cmax]
    ans.sort()
    print('\n'.join(ans))
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import collections
def main():
    N = int(input())
    S = [str(input()) for i in range(N)]
    c = collections.Counter(S)
    ans = []
    tmp = []
    tmp = c.most_common()
    cmax = c.most_common()[0][1]
    for i in range(N):
        if tmp[i][1] != cmax:
            break
        ans.append(tmp[i][0])
    ans.sort()
    print('\n'.join(ans))
if __name__ == '__main__':
    main()

Fixed submission:
# -*- coding: utf-8 -*-
from collections import Counter
def main():
    N = int(input())
    S = [input() for i in range(N)]
    c = Counter(S)
    ans = []
    tmp = []
    tmp = c.most_common()
    cmax = c.most_common()[0][1]
    ans = [k for k , j in c.items() if j == cmax]
    ans.sort()
    print('\n'.join(ans))
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import collections
def main():
    N = int(input())
    S = [str(input()) for i in range(N)]
    c = collections.Counter(S)
    ans = []
    tmp = []
    tmp = c.most_common()
    cmax = c.most_common()[0][1]
    for i in range(N):
        if tmp[i][1] != cmax:
            break
        ans.append(tmp[i][0])
    ans.sort()
    for j in ans:
        print(j)
if __name__ == '__main__':
    main()

Fixed submission:
# -*- coding: utf-8 -*-
from collections import Counter
def main():
    N = int(input())
    S = [input() for i in range(N)]
    c = Counter(S)
    ans = []
    tmp = []
    tmp = c.most_common()
    cmax = c.most_common()[0][1]
    ans = [k for k , j in c.items() if j == cmax]
    ans.sort()
    print('\n'.join(ans))
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import collections
def main():
    N = int(input())
    S = [str(input()) for i in range(N)]
    c = collections.Counter(S)
    ans = []
    for i in range(N):
        if c.most_common()[i][1] != c.most_common()[0][1]:
            break
        ans.append(c.most_common()[i][0])
    ans.sort()
    for j in ans:
        print(j)
if __name__ == '__main__':
    main()

Fixed submission:
# -*- coding: utf-8 -*-
from collections import Counter
def main():
    N = int(input())
    S = [input() for i in range(N)]
    c = Counter(S)
    ans = []
    tmp = []
    tmp = c.most_common()
    cmax = c.most_common()[0][1]
    ans = [k for k , j in c.items() if j == cmax]
    ans.sort()
    print('\n'.join(ans))
if __name__ == '__main__':
    main()