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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

public class Solution {
  
  public static void main(String args[]) throws IOException {
    BufferedReader bi = new BufferedReader(new InputStreamReader(System.in));
    //BufferedReader bi = new BufferedReader(new FileReader(new File("E:\\test.txt")));
    
    /*String[] paramsStr = bi.readLine().split(" ");
    int n = Integer.parseInt(paramsStr[0]);
    int nDecrement = Integer.parseInt(paramsStr[1]);*/
    
    bi.readLine();
    
    String toAnalyze = bi.readLine();
    Map<String, Integer> bigrams = new HashMap<>();
    int max = 0;
    String ret = null;
    
    for (int i = 0; i < toAnalyze.length() - 1; ++i) {
      String curBigram = toAnalyze.substring(i, i + 2);
      Integer occurences = bigrams.get(curBigram);
      if (occurences == null) {
        bigrams.put(curBigram, 1);
        occurences = 1;
      }
      if (occurences > max) {
        max = occurences;
        ret = curBigram;
      }
    }
    
    System.out.println(ret);
    
    //long startTime = System.currentTimeMillis();
    
    bi.close();
    
    //System.out.println("Time in ms : " + (System.currentTimeMillis() - startTime));
  }

}
