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 two_gram(n,s):
    a = s[0:2]
    maior = 0
    menor = 0
    for i in range(0,len(s)-1):
        #print(f'agora estou comparando {s[i:i+2]}')
        for j in range(i+1,len(s)-1):
            if s[i:i+2] == s[j:j+2]:
                #print(f'achei um valor igual a {s[j:j+2]}')
                menor += 1
                #print(menor)

        if maior < menor:

            #print(maior,menor,s[i:i+2])
            maior = menor
            a = s[i:i+2]
            #print(f'a esta valendo {s[i:i+2]}')
        menor = 0





    return a

a = int(input())
b = str(input())
print(two_gram(a,b))