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

public class Two_gram {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner Reader=new Scanner(System.in);
		
		int size=Reader.nextInt();
		
		String s=Reader.next();
		
		HashMap<String,Integer> map=new HashMap<String,Integer>();
		
		String bool="";
		String least="";
		long l=0;
		
		for(int i=1;i<size;i++) {
			
			String temp= s.substring(i-1,i+1);
			
			if(!bool.contains(temp)) {
				map.put(temp,1);
				bool+=temp+"_";
				if(l==0)
				{
					l=1;
					least=temp;
				}
			}
			
			else { int x=map.get(temp);
			map.put(temp,x+1);
			//System.out.println(map.get(temp));
				if(l<map.get(temp)) {
					l=map.get(temp);
				//	System.out.println(l);
					least=temp;
			}
			}
		}
		System.out.println(least);
		//System.out.println(l);
	}

}
