실버4 문제
n = int(input())
arr = []
for _ in range(n):
arr.append(input())
arr.sort()
target = arr[0]
cnt = 0
imax = 0
answer = arr[0]
for i in range(1, n):
if (target == arr[i]):
cnt += 1
else:
target = arr[i]
cnt = 0
if (cnt > imax):
imax = cnt
answer = arr[i]
print(answer)
n = int(input())
books = {}
for _ in range(n):
book = input()
if book not in books:
books[book] = 1
else:
books[book] +=1
max_freq = max(books.values())
best_seller=[]
for book, number in books.items():
if number ==max_freq:
best_seller.append(book)
print(sorted(best_seller)[0])