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

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		
		String sc = scan.nextLine();
		String str = scan.nextLine();
		
		String[] s = new String[n-1];
	
		
		for (int i = 0; i < s.length; i++) {
		
			s[i] = str.charAt(i)+"" + str.charAt(i + 1);
			for(int j = 0;j < i;j++){
				
				if(s[i].equals(s[j])) {
					s[i] = "";
					break;
				}
				
			}
			
		}
		
		

		
		int[] count = new int[n - 1];
		String str2 = str;

		for (int i = 0; i < s.length; i++) {
			int t = 0;
			
			if(s[i].equals("")) continue;
			
			
			while (true) {

				if (str2.indexOf(s[i]) == -1)
					break;
				count[i]++;
				int x = str2.indexOf(s[i]);
				str2 = str2.substring(x+2);

			}

		}
		
		int max = count[0];
		int flag = 0;
		for(int i = 0;i < n-1;i++)
			if(count[i] > max){
				
				max = count[i];
				flag = i;
				
			}
		
		System.out.println(s[flag]);
		

	}

}
