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 A{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		String stringEnter = sc.next();
		
		String[] arrStr = new String[n - 1];
		int[] arrNum = new int[n - 1];
		
		for(int counter = 0; counter < n - 1; counter++) {
			arrNum[counter] = 0;
		}
		
		int realPos = 0;
		for(int counter = 0; counter < n - 1; counter++) {
			String current = "";
			current += stringEnter.charAt(counter) + "" + stringEnter.charAt(counter + 1);
			boolean flag = true;
			for(int innerCounter = 0; innerCounter < n - 1; innerCounter++) {
				if(arrStr[innerCounter] != null && arrStr[innerCounter].equals(current)) {
					arrNum[innerCounter]++;
					flag = false;
					break;
				}
			}
			if(flag) {
				arrStr[realPos] = current;
				arrNum[realPos] += 1;
				realPos++;
			}
			
		}
		int max = 0;
		for(int counter = 1; counter < n - 1; counter++) {
			if(arrNum[counter] > arrNum[max]) {
				max = counter;
			}
		}
		
		System.out.println(arrStr[max]);
		
	}

}
