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, k):
    largest_occurence = 0;
    largest_occurence_str = ""
    count_occurences = 0;

    for i in range(n):
        potential_2gram = k[i:i+2]

        if len(potential_2gram) == 2:
            count_occurences = 0
            for i in range(n):
                if k[i: i + 2] == potential_2gram:
                    count_occurences = count_occurences + 1
                print(count_occurences)
            if count_occurences > largest_occurence:
                largest_occurence = count_occurences
                largest_occurence_str = potential_2gram

    print(largest_occurence_str)

if __name__ == "__main__":
    x = raw_input()
    y = raw_input()

    two_gram(int(x), str(y))