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.*;

public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String s=sc.next();
		int i;
		HashMap<String,Integer> hmap=new HashMap<String,Integer> ();
		for(i=0;i<n-2;i++)
		{
			String s1=s.substring(i,i+2);
			if(hmap.containsKey(s1))
			    hmap.put(s1,(hmap.get(s1))+1);
			
			else
			    hmap.put(s1,1);
		}
		String s4=(s.substring(n-2,n));
		if(hmap.containsKey(s4))
		    hmap.put(s4,(hmap.get(s4))+1);
		
		if(hmap.size()==0)
		  System.out.println(s.substring(0,2));
		else
		{
		int max=0;
		String stri="";
		for(Map.Entry<String,Integer> entry: hmap.entrySet())
		{
			if(entry.getValue()>max)
			{
				max=entry.getValue();
				stri=entry.getKey();
				
			}
		}
		System.out.println(stri);
	}
}
}