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.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

/**
 * necklace -
 * pearls o
 * @author Rodrigo
 *
 */
public class Main {
	static Scanner sc = new Scanner(System.in);

	private static void multipleEntrace(){
		while(sc.hasNextLine()){
			String linha =sc.next(); 
			p(linha);
			
			
		}
	}
	private static void OneByOneEntrace(){
		
		Integer number = sc.nextInt();
		String linha = sc.nextLine();
		linha = sc.nextLine();
		linha="+"+linha+"+";
        Map<String,Integer> example = new HashMap<String,Integer>();
		for(int i=1; i<linha.length();i++ ) {
			char last = linha.charAt(i-1);
			char current = linha.charAt(i);
			char next = linha.charAt(i+1);
			
			if(next=='+') break;
				if(next!='+') {
					String pair = ""+String.valueOf(current)+String.valueOf(next);
					if(example.containsKey(pair)) {
						example.put(pair, example.get(pair).intValue()+1);
					} else {
						example.put(pair, 1);
					}
				}
		}
		boolean existe=false;
		for (String key : example.keySet()) {
			Integer value = example.get(key);
			if(nPositivo(value)>1) {
				p(key/* +"  -" +value*/);
				existe=true;
				break;
			}
		}
		
		if(existe==false)
		for (String key : example.keySet()) {
			Integer value = example.get(key);
			if(nPositivo(value)==1) {
				p(key/* +"  -" +value*/);
				break;
			}
		}
	}
    public static String sortString(String inputString) 
    { 
        // convert input string to char array 
        char tempArray[] = inputString.toCharArray(); 
          
        // sort tempArray 
        Arrays.sort(tempArray); 
          
        // return new sorted string 
        return new String(tempArray); 
    }
	public static void main(String[] args) {
//		multipleEntrace();
		OneByOneEntrace();
	}
	
	public static Integer nPositivo(Integer x){
		return Math.abs(x);
	}
//	public static List<Long> sort(List<Long> numbers){
//		numbers.sort(Comparator.naturalOrder());
//		return numbers;
//	}
	
	public static String reverse (String x){
		return new StringBuilder(x).reverse().toString();
	}
	public static List<Long> reverse (List<Long> x){
		Collections.reverse(x);
		return x;
	 }
	public static void p(StringBuilder x){
		p(x.toString());
	}
	public static void p(String x){
		System.out.println(x);
	}
	public static void p(Long x){
		System.out.println(x);
	}	
	public static void p(Integer x){
		System.out.println(x);
	}
	public static void p(List<Integer> x){
		System.out.println(x);
	}
	public static void pNoBorder(List<Integer> x){
		System.out.println(x.toString().substring(1, x.toString().length()-1));
	}
}
