import sys
from collections import defaultdict

def solve():
    input = sys.stdin.readline
    N = int(input())
    sDict = defaultdict(int)
    maxCount = 0
    for i in range(N):
        s = input().strip("\n")
        sDict[s] += 1
        maxCount = max(maxCount, sDict[s])
    maxS = []
    for key in sDict:
        if sDict[key] == maxCount:
            maxS.append(key)
    maxS.sort()
    print(*maxS, sep="\n")

    return 0

if __name__ == "__main__":
    solve() import sys sys from collections import defaultdict def solve():
    input = sys.stdin.readline
    N = int(input())
    sDict = defaultdict(int)
    maxCount = 0
    for i in range(N):
        s = input().strip("\n")
        sDict[s] += 1
        maxCount = max(maxCount, sDict[s])
    maxS = []
    for key in sDict:
        if sDict[key] == maxCount:
            maxS.append(key)
    maxS.sort()
    print(*maxS, sep="\n")

    return 0 solve input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline N = int(input()) N int(input()) int input() input sDict = defaultdict(int) sDict defaultdict(int) defaultdict int maxCount = 0 maxCount 0 for i in range(N):
        s = input().strip("\n")
        sDict[s] += 1
        maxCount = max(maxCount, sDict[s])
     i range(N) range N s = input().strip("\n") s input().strip("\n") ().strip () input strip "\n" sDict[s] += 1 sDict[s] sDict s 1 maxCount = max(maxCount, sDict[s]) maxCount max(maxCount, sDict[s]) max maxCount sDict[s] sDict s maxS = [] maxS [] for key in sDict:
        if sDict[key] == maxCount:
            maxS.append(key)
     key sDict if sDict[key] == maxCount:
            maxS.append(key)
     sDict[key] == maxCount sDict[key] sDict key maxCount maxS.append(key) maxS.append maxS append key maxS.sort() maxS.sort maxS sort print(*maxS, sep="\n") print *maxS maxS sep="\n" sep "\n" return 0 0 if __name__ == "__main__":
    solve() __name__ == "__main__" __name__ "__main__" solve() solve def solve():
    input = sys.stdin.readline
    N = int(input())
    sDict = defaultdict(int)
    maxCount = 0
    for i in range(N):
        s = input().strip("\n")
        sDict[s] += 1
        maxCount = max(maxCount, sDict[s])
    maxS = []
    for key in sDict:
        if sDict[key] == maxCount:
            maxS.append(key)
    maxS.sort()
    print(*maxS, sep="\n")

    return 0 def solve():
    input = sys.stdin.readline
    N = int(input())
    sDict = defaultdict(int)
    maxCount = 0
    for i in range(N):
        s = input().strip("\n")
        sDict[s] += 1
        maxCount = max(maxCount, sDict[s])
    maxS = []
    for key in sDict:
        if sDict[key] == maxCount:
            maxS.append(key)
    maxS.sort()
    print(*maxS, sep="\n")

    return 0 solve
import sys
from collections import defaultdict

def solve():
    input = sys.stdin.readline
    N = int(input())
    sDict = defaultdict(int)
    maxCount = 0
    for i in range(N):
        s = input().strip("\n")
        sDict[s] += 1
        maxCount = max(maxCount, sDict[s])
    maxS = []
    for key in sDict:
        if sDict[key] == maxCount:
            maxS.append(key)
    maxS.sort()
    print(*maxS, sep="\n")

    return 0

if __name__ == "__main__":
    solve()