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

#!/usr/bin/env python
# coding: utf-8

# In[4]:


# import math
# for i in range(int(input())):
#     a,b=map(int,input().split())
#     if a%b==0 or a%b<=1.5:
#         print(a)
#     else:
#         no=int(a/b)
#         no+=.5
#         print(math.floor(b*no))


# In[10]:


# import math
# for i in range(int(input())):
#     a,b=map(int,input().split())
#     frac,asd=math.modf(a/b)
#     if a%b==0 or frac<=.5:
#         print(a)
#     else:
#         no=int(a/b)
#         no+=.5
#         print(int(b*no))


# In[4]:


n=int(input())
s=input()
d={}
a=0
for i in range(n-1):
    a=s[i]+s[i+1]
    if d.get(a):
        d[a]+=1
    else:
        d[a]=1
max_key = max(d, key=d.get)
print(max_key)
    
    


# In[ ]:




