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.Arrays;
import java.util.Scanner;

public class Tren1 {

	public static void main(String[] args){
		Scanner scn=new Scanner(System.in);
		int N=scn.nextInt();
		String str=scn.next();
		String ans="";
		int max=0;
		String mas[]=new String[N-1];
		for(int i=0;i<N-1;i++)
			mas[i]=str.substring(i, i+2);
		Arrays.sort(mas);
		int cur=1;
		for(int i=0;i<N-2;i++){
			if(mas[i].equals(mas[i+1])) cur++;
			else{
				if(cur>max){
					ans=mas[i];
					max=cur;
				}
				cur=1;
			}
		}
		if(cur>max) ans=mas[N-2];
		System.out.println(ans);
	}
}