N = int(input()) eye_num = [[i, 0] for i in range(1001)] for i in range(N): eye = input() eye_len = len(eye) - 2 eye_num[eye_len][1] += 1 eye_num = sorted(eye_num, reverse=True, key=lambda x: (x[1], x[0])) print(eye_num[0][0])