import sys
import collections

input = sys.stdin.readline

def main():
    N = int(input())
    Slist = []
    for _ in range(N):
        Slist.append(str(input()[:-1]))
    SlistCounter = list(collections.Counter(Slist).items())
    SlistCounter.sort(key=lambda x: x[0])
    SlistCounter.sort(key=lambda x: x[1], reverse=True)
    maxcnt = SlistCounter[0][1]
    for s, cnt in SlistCounter:
        if cnt != maxcnt:
            break
        print(s)

if __name__ == "__main__":
    main() import sys sys import collections collections input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def main():
    N = int(input())
    Slist = []
    for _ in range(N):
        Slist.append(str(input()[:-1]))
    SlistCounter = list(collections.Counter(Slist).items())
    SlistCounter.sort(key=lambda x: x[0])
    SlistCounter.sort(key=lambda x: x[1], reverse=True)
    maxcnt = SlistCounter[0][1]
    for s, cnt in SlistCounter:
        if cnt != maxcnt:
            break
        print(s) main N = int(input()) N int(input()) int input() input Slist = [] Slist [] for _ in range(N):
        Slist.append(str(input()[:-1]))
     _ range(N) range N Slist.append(str(input()[:-1])) Slist.append Slist append str(input()[:-1]) str input()[:-1] () input :-1 -1 SlistCounter = list(collections.Counter(Slist).items()) SlistCounter list(collections.Counter(Slist).items()) list collections.Counter(Slist).items() collections.Counter(Slist).items collections.Counter(Slist) collections.Counter collections Counter Slist items SlistCounter.sort(key=lambda x: x[0]) SlistCounter.sort SlistCounter sort key=lambda x: x[0] key lambda x: x[0] x[0] x 0 x SlistCounter.sort(key=lambda x: x[1], reverse=True) SlistCounter.sort SlistCounter sort key=lambda x: x[1] key lambda x: x[1] x[1] x 1 x reverse=True reverse True maxcnt = SlistCounter[0][1] maxcnt SlistCounter[0][1] [0] SlistCounter 0 1 for s, cnt in SlistCounter:
        if cnt != maxcnt:
            break
        print(s) s cnt SlistCounter if cnt != maxcnt:
            break
         cnt != maxcnt cnt maxcnt break print(s) print s if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main input = sys.stdin.readline sys.stdin.readline input def main():
    N = int(input())
    Slist = []
    for _ in range(N):
        Slist.append(str(input()[:-1]))
    SlistCounter = list(collections.Counter(Slist).items())
    SlistCounter.sort(key=lambda x: x[0])
    SlistCounter.sort(key=lambda x: x[1], reverse=True)
    maxcnt = SlistCounter[0][1]
    for s, cnt in SlistCounter:
        if cnt != maxcnt:
            break
        print(s) def main():
    N = int(input())
    Slist = []
    for _ in range(N):
        Slist.append(str(input()[:-1]))
    SlistCounter = list(collections.Counter(Slist).items())
    SlistCounter.sort(key=lambda x: x[0])
    SlistCounter.sort(key=lambda x: x[1], reverse=True)
    maxcnt = SlistCounter[0][1]
    for s, cnt in SlistCounter:
        if cnt != maxcnt:
            break
        print(s) main
import sys
import collections

input = sys.stdin.readline

def main():
    N = int(input())
    Slist = []
    for _ in range(N):
        Slist.append(str(input()[:-1]))
    SlistCounter = list(collections.Counter(Slist).items())
    SlistCounter.sort(key=lambda x: x[0])
    SlistCounter.sort(key=lambda x: x[1], reverse=True)
    maxcnt = SlistCounter[0][1]
    for s, cnt in SlistCounter:
        if cnt != maxcnt:
            break
        print(s)

if __name__ == "__main__":
    main()
