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.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import static java.lang.Math.*;
 
/// Codeforces Round #479 (Div. 3)
public class Solution implements Runnable {
 
        BufferedReader in;
        // PrintWriter out;
        // StringTokenizer tok = new StringTokenizer("");
 
        public static void main(String[] args) {
                new Thread(null, new Solution(), "", 256 * (1L << 20)).start();
        }
 
        public void run() {
                try {
                        long t1 = System.currentTimeMillis();
                        in = new BufferedReader(new InputStreamReader(System.in));
                             
                        solve();
                        in.close();
                        // out.close();
                        long t2 = System.currentTimeMillis();
                        System.err.println("Time = " + (t2 - t1));
                } catch (Throwable t) {
                        t.printStackTrace(System.err);
                        System.exit(-1);
                }
        }
 
     
     
        // solution
 
        void solve() throws IOException {
            int n = Integer.parseInt(in.readLine());
            String s = in.readLine();
            
            HashMap<String, Integer> occurences = new HashMap<String, Integer>();
            String mosTwoGram = "";
            int maxCount = 0;
            
            String curr;
            for(int i = 1; i < n; i++){
                curr = s.charAt(i-1)+ "" + s.charAt(i);
                if(occurences.containsKey(curr)){
                    occurences.put(curr, occurences.get(curr) + 1);
                }else{
                    occurences.put(curr, 1);
                }
                
                if(occurences.get(curr) > maxCount){
                    maxCount = occurences.get(curr);
                    mosTwoGram = curr;
                }
                
            }
            
            System.out.println(mosTwoGram);
        }
 
}