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

    
    public static void main(String[] args) {
    String str;
        HashMap<String, Integer> map= new HashMap<String, Integer>();
     int ptr1=0, ptr2=2;
     Scanner sc= new Scanner(System.in);
     int n= Integer.parseInt(sc.nextLine());
     str= sc.nextLine();
     while(ptr2<str.length()){
         String subs=str.substring(ptr1, ptr2);
       if(!map.containsKey(subs)) map.put(subs, 1);
       else{
           map.put(subs, map.get(subs)+1);
       }
       ptr1++;
       ptr2++;
     }
     Set<Map.Entry<String, Integer>> e= map.entrySet();
     Iterator it= e.iterator();
     String  max=null;
     int maxi=0;
     while(it.hasNext()){
         Map.Entry<String, Integer> ent= ( Map.Entry<String, Integer> )it.next();
         if(ent.getValue()>maxi){
             maxi=ent.getValue();
             max=ent.getKey();
         }
     }
        System.out.println(max);
     
    }
    
}

