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

class Solution:

    def solve(self, n, s):

        i = 0
        j = 1
        str_list = list(s)
        gram_dict = dict()
        while(j < n):
            
            if(str_list[i]+str_list[j] in gram_dict.keys()):
                gram_dict[str_list[i]+str_list[j]] += 1
            else:
                gram_dict[str_list[i]+str_list[j]] = 1

            i += 1
            j += 1

        max_v = max(gram_dict.values())
        
        for i in gram_dict.keys():
            if gram_dict[i] == max_v:
                return i

if __name__ == '__main__':

    s = Solution()
    
    n = int(input())
    st = input()

    print(s.solve(n,st))

