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.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;


public class TwoGram {
	public static void main(String[] args)throws Exception{
		Map<String, Integer> map = new HashMap<>();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int length = Integer.parseInt(br.readLine());
		String input = br.readLine();
		int tempCounter = 0;
		String output = new String();
		for(int i = 0 ; i <length-1 ; i++) {
			int local = i+2;
			int localCounter = 0;
			if(map.containsKey(input.substring(i, local))){
				localCounter = map.get(input.substring(i, local));
				map.put(input.substring(i, local),  ++localCounter);
				if(tempCounter < localCounter) {
					tempCounter = localCounter;
					output =  input.substring(i, local);
					
				}
			}else {
				map.put(input.substring(i, local), localCounter);
			}
		}
		
		if(output.length()==0) {
			System.out.println(input.substring(length-2, length));
		}
		else{
		    System.out.println(output);    
		}
		//System.out.println(map);
		
	}
 
}