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

    
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int x = in.nextInt();
        String s = in.next();
        String []pair = new String[x-1];
        int []counter =new int[x-1];
        for(int i=0;i<counter.length;i++){
            counter[i]=0;
        }
        for(int i=0;i<x-1;i++){
        pair[i]=(String)(s.charAt(i) +""+ s.charAt(i+1));
    }
        for(int i=0;i<x-2;i++){
            for(int j=i+1;j<x-1;j++){
                if(pair[i]==pair[j]){
                    counter[i]++;
                }
            }
        }
        int max=counter[0];
        int pmax=0;
        for(int i=1;i<counter.length;i++){
            if(counter[i]>max){
                max=counter[i];
                pmax=i;
            }
        }
        System.out.println(pair[pmax]);
    }
    
}