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

    public static int max=0;
    public static String max_str;

	public static void countFreq(String arr[]) 
	{ 
	    boolean visited[] = new boolean[arr.length]; 
	    String s1;
	    String s2;
	    for (int i = 1; i < arr.length-1; i++) { 
	    	    s1=arr[i];
	  	        if (visited[i] == true) 
	            continue; 
	  	        int count = 1; 
	        for (int j = i + 1; j<arr.length; j++) { 
	        	s2=arr[j];
	        	if(s1.charAt(0)==s2.charAt(0) && s1.charAt(1)==s2.charAt(1) ){
	                visited[j] = true; 
	                count++; 
	           
	            } 
	        }
	        if(count>max){
            max=count;
            max_str=arr[i];
	        }
	    } 
	}
	 
	public static void main(String[] args) {
		String concat="";
		
		Scanner sc=new Scanner(System.in);
		int len=sc.nextInt();
		sc.nextLine();
		String str=sc.nextLine();
		
	    String [] concArr=new String[str.length()];
		char []subStr=new char [str.length()];
		
		if(2<=len && len<=100){
			System.out.println("INSIDE IF");
  			for(int j=0;j<str.length();j++){
					subStr[j]=str.charAt(j);				 
					if(j>=1){
					concat=concat+str.charAt(j-1)+str.charAt(j);
					concArr[j]= concat;
					concat="";
					}
			    }
		}//if 
		countFreq(concArr);
		System.out.println(max_str);
		
	}

}
