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

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	Scanner sc;
	PrintWriter pw;
     
  	public Ideone(){
		sc = new Scanner(System.in);
      
		int s = sc.nextInt();
		String text = sc.next();

		String res = "";
		int max = 0;
		for(int i = 0; i < text.length()-1; i++){
			String now = text.charAt(i) +""+ text.charAt(i+1);
			int count = 1;
			for(int j = i+1; j < text.length() -1; j++){
				String forCheck = text.charAt(j) +""+ text.charAt(j+1);
				if(forCheck.equals(now)){
					count++;
				}
			}
			if(max < count){
				max = count;
				res = now;
			}
		}
	
		System.out.println(res);

	}
	
	public static void main (String[] args) throws java.lang.Exception
	{
		new Ideone();
	}
}