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


import java.util.*;
import java.lang.*;
import java.io.*;
 
/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{   public static void main (String[] args) throws java.lang.Exception
	{
		Scanner ob=new Scanner(System.in);
        int n;
        n=ob.nextInt();
        String s=ob.next();
        char a[]=s.toCharArray();
        int ans=0;
        String se="";
        for(int i=0;i<n-1;i++)
        {int count=1;
            for(int j=i+2;j<n;j++)
            {
        
                if(j<n-1 && a[i]==a[i+1] && a[i+1]==a[j] && a[j+1]==a[j])
                 {
                   count++;
                 }
                else if(j<n-1 && a[i]==a[j] && a[i+1]==a[j+1] )
                {
                    count++;
                }
            }
            if(count>ans)
            {
                ans=count;
                se=String.valueOf(a[i])+String.valueOf(a[i+1]);
            }
        }
        System.out.println(se);
	}

 
}