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

public class TwoGram {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		String str = s.next();
		int[] count = new int[26];
		//ArrayList<String> ll = new ArrayList<>();
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<n-1;i++) {
			if((str.charAt(i) - 'A') - (str.charAt(i+1) - 'A') == 1) {
				count[str.charAt(i) - 'A']++;
			}
			if((str.charAt(i) - 'A') - (str.charAt(i+1) - 'A') == -1) {
				count[str.charAt(i) - 'A']++;
			}
			
		}
		int max = -1;
		int indx = -1;
		for(int i= 0;i<26;i++) {
			
			if(count[i] > max ) {
				max = count[i];
				indx =i;
			}
		}
		sb.append(str.charAt(indx));
		sb.append(str.charAt(indx+1));

		System.out.println(sb.toString());
	}

}
