from collections import Counter

import sys

input = sys.stdin.readline

n=int(eval(input()))

s=[]

for _ in range(n):

    s.append(input().rstrip())

c = Counter(s)

ans=[]

max_vote = max(c.values())

for i,j in list(c.items()):

    if j == max_vote:

        ans.append(i)

print(("\n".join(sorted(ans))))
def main():

    from collections import Counter

    import sys

    input = sys.stdin.readline

    n=int(eval(input()))

    s=[]

    for _ in range(n):

        s.append(input().rstrip())

    c = Counter(s)

    ans=[]

    max_vote = max(c.values())

    for i,j in list(c.items()):

        if j == max_vote:

            ans.append(i)

    print(("\n".join(sorted(ans))))

main()
from collections import Counter
import sys

input = sys.stdin.readline
n = int(eval(input()))
s = []
for _ in range(n):
    s.append(input().rstrip())
c = Counter(s)
ans = []
max_vote = max(c.values())
for i, j in list(c.items()):
    if j == max_vote:
        ans.append(i)
print(("\n".join(sorted(ans))))

def main():
    from collections import Counter
    import sys

    input = sys.stdin.readline
    n = int(eval(input()))
    s = []
    for _ in range(n):
        s.append(input().rstrip())
    c = Counter(s)
    ans = []
    max_vote = max(c.values())
    for i, j in list(c.items()):
        if j == max_vote:
            ans.append(i)
    print(("\n".join(sorted(ans))))


main()

-from collections import Counter -import sys +def main(): +    from collections import Counter +    import sys -input = sys.stdin.readline -n = int(eval(input())) -s = [] -for _ in range(n): -    s.append(input().rstrip()) -c = Counter(s) -ans = [] -max_vote = max(c.values()) -for i, j in list(c.items()): -    if j == max_vote: -        ans.append(i) -print(("\n".join(sorted(ans)))) +    input = sys.stdin.readline +    n = int(eval(input())) +    s = [] +    for _ in range(n): +        s.append(input().rstrip()) +    c = Counter(s) +    ans = [] +    max_vote = max(c.values()) +    for i, j in list(c.items()): +        if j == max_vote: +            ans.append(i) +    print(("\n".join(sorted(ans)))) + + +main()