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

def hate_for_one_check(str_len, dgramm):
    if str_len == 2:
        print (dgramm)
        return
    
    cardmaster = []
    for sub in range(len(dgramm)):
        cardmaster.append(dgramm[sub:sub+2:])
        sub +=2
    
    if str_len % 2 == 0:
        del cardmaster[-1]
    #print(cardmaster)
    
    
    result = dict()
    for sub in cardmaster:
        if sub not in result:
            result[sub] = 1
        else:
            result[sub] +=1
 
    
    max_value = max(result.values())
    max_keys = [k for k, v in result.items() if v == max_value]
    print((max_keys)[0])


str_len = int(input())
dgramm = input()
hate_for_one_check(str_len, dgramm)
