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.*;
public class Test{
	static int countFreq(String ss,String os){
		int osl = os.length();
		int ssl = ss.length();
		int c = 0;
		for(int i=0;i<=osl-ssl;i++){
			int j;
			for( j = 0;j<ssl;j++){
				if(os.charAt(i+j)==ss.charAt(j)){
					c++;
				}
			}
		}
		return c;
	}

	// static int countFreq(String pat, String txt) {         
 //        int M = pat.length();         
 //        int N = txt.length();         
 //        int res = 0; 
  
 //        /* A loop to slide pat[] one by one */
 //        for (int i = 0; i <= N - M; i++) { 
 //            /* For current index i, check for  
 //        pattern match */
 //            int j;             
 //            for (j = 0; j < M; j++) { 
 //                if (txt.charAt(i + j) != pat.charAt(j)) { 
 //                    break; 
 //                } 
 //            } 
  
 //            // if pat[0...M-1] = txt[i, i+1, ...i+M-1]  
 //            if (j == M) {                 
 //                res++;                 
 //                j = 0;                 
 //            }             
 //        }         
 //        return res;         
 //    } 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int len = sc.nextInt();
		sc.nextLine();
		String os = sc.nextLine();
		int max = 0;
		String res = "";
		for(int i=0;i<os.length();i++){
			for(int j=i+1;j<=os.length();j++){
				String tt = os.substring(i,j);
				if(tt.length() == 2){
					if(countFreq(tt,os)>max){
						max = countFreq(tt,os);
						res = tt;
					}
				}
			}	
		}
		System.out.print(res);
	}
}