import collections

f = open("input.txt")

for _ in f:
    c = collections.Counter(input().split())
    words, length = [], 0
    for w, c in c.most_common():
        length = max(length, c)
        if length != c:
            break
        words.append(w)
    words.sort()
    print(words[0])

#Test 3
#input:
#q w e r t y u i o p
#a s d f g h j k l
#z x c v b n m
#Wrong answer.
#correct output:
#a