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

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Arrays;
import java.math.BigInteger;
 
/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
     public static void main (String[] args) throws java.lang.Exception
     {
     	Scanner in =new Scanner(System.in);
		int n,j,t=1,i;
		//substring( //toCharArray();
		//Arrays.sort();
		String s1="",st="";
		int p,h,r,m,l,k;
		long x,y,z;
	     for(i=0;i<t;i++)
		{
		     p=0;h=0;
		     n=in.nextInt();
		     s1=in.next();
		     char c[]=s1.toCharArray();
		     String s[]=new String[n-1];
		     for(j=0;j<n-1;j++)
		     {
		          s[j]=s1.substring(j,j+2);
		     }
		     m=0;
		     for(j=0;j<n-1;j++)
		     {
		          p=0;
		          for(k=0;k<n-1;k++)
		          {
		               if(s[j]==s[k])
		                    p++;
		          }
		          if(p>m)
		          {
		               m=p;st=s[j];
		          }
		     }
		     System.out.println(st);
		}
     }
}