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

string_length = int(input())
input_string = list(input())

two_gram_dict = {}

idx_i = 0
idx_j = 1
while idx_j < string_length:
    two_gram_key = "".join(input_string[idx_i:idx_j+1])
    if two_gram_key not in two_gram_dict:
        two_gram_dict[two_gram_key] = 1
    else:
        two_gram_dict[two_gram_key] += 1
    #print(two_gram_key)
    idx_i += 1
    idx_j += 1

#print("!!!!")

maximal_two_grams = ""
maximal_count = 0
for key in two_gram_dict:
    if two_gram_dict[key] > maximal_count:
        maximal_two_grams = key
        maximal_count = two_gram_dict[key]
    #print(key)
    #print(two_gram_dict[key])

#print("!!!!")
print(maximal_two_grams)
 							 		  	 		  	 		  						