15
MIRZOYANOVECLOX
 23
AABBBAAACCCCCAAADDDDDDD
 2
QA
 11
GGRRAATTZZZ
 6
AZAZAZ
 10
SQSQSQSQTG
 3
KEK
 100
URXCAIZFIBNJTPCZHBQIBCILLPXZCFGMKKZMNPLCYGAVJVIBMCZEBSJWPSCPQDYCTTKPOKIJRSKIZPDGCHVOUTMPNECYORSFZFNC
 3
LOL
 2
WW
 8
PUTINVOR
 26
QWERTYUIOPASDFGHJKLZXCVBNM
 5
AZAZA
 9
EGORLETOV
 7
KADUROV
 9
MIKEPIDOR
 9
AAAAAAAAA
 100
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 5
FUFEL
 50
NYQAHBYYOXLTRYQDMVENEMAQNBAKGLGQOLXNAIFNQTOCLNNQIA

MI
 DD
 QA
 ZZ
 AZ
 SQ
 KE
 IB
 LO
 WW
 PU
 QW
 AZ
 EG
 KA
 MI
 AA
 AA
 FU
 YQ

#!/usr/bin/python

from __future__ import print_function
import math
import sys

d = {}

def ss(st):
    if len(st) < 2: return
    s = set({})
    a = []
    for ii in range(1, len(st)):
        s.add(st[ii] + st[ii-1])

    for ii in range(len(s)):
        a.append(0)

    for ii in s:
        d.update({ii: 0})

    for ii in range(1, len(st)):
        d[st[ii] + st[ii-1]] += 1

    x = st[0] + st[1]
    y = d[st[0] + st[1]]
    for ii in d:
        if d.get(ii) > y:
            x = ii

    print(x)

def main():
    m = raw_input()
    ss(m)

if __name__ == '__main__':
    main()