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.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        String word = in.next();
//        Set<String> mySet = new HashSet<>();
        Map<String,Integer> myMap = new HashMap<>();
        for (int i = 0;i<n-1;i++){
            if(myMap.containsKey(word.substring(i,i+2)))
                myMap.put(word.substring(i,i+2), myMap.get(word.substring(i,i+2))+1);

            else {
                myMap.put(word.substring(i,i+2),1);
            }
        }
        int max = Collections.max(myMap.values());
        List<Integer> myValues = new ArrayList<>(myMap.values());
        List<String> myKeys = new ArrayList<>(myMap.keySet());
        for (int i = 0;i <myValues.size();i++){
            if (myValues.get(i) == max)
                System.out.println(myKeys.get(i));
                break;
        }

    }


}



