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

	
	public static void main(String[] args) {
		Scanner IN = new Scanner(System.in);
		
		int k = IN.nextInt();
		String n = IN.next();
		char[] HoldN = n.toCharArray();
		String[] HoldZirBaze= new String[k-1];
		int i=0;
		String HoldS="";
		while(i<n.length()-1) {
			HoldS="";
			HoldS+=HoldN[i];
			HoldS+=HoldN[i+1];
			HoldZirBaze[i]=HoldS;
			i++;
		}
		
		int j=0;
		int u=0;
		int h=0;
		int[] Td  = new int[n.length()-1];
		while(j<n.length()-1) {
			h=0;
			u=0;
			while(u < n.length() - 1) {
				if(HoldZirBaze[j].equals(HoldZirBaze[u])) {
					h++;
				}
				u++;
			}
			Td[j]=h;
			j++;
		}
	int g;
	String G;
		for(int l=0 ; l<n.length() -1 ;l++) {
			for (int l2 = 0; l2 < (n.length() -1)-l; l2++) {
				if(Td[l2]>Td[l2]) {
					g=Td[l2];
					Td[l2]=Td[j+1];
					Td[j+1]=g;
					G=HoldZirBaze[l2];
					HoldZirBaze[l2]=HoldZirBaze[l2+1];
					HoldZirBaze[l2+1]=G;
				}
			}
		}
		boolean f = false;
		for (int l = 0; l < Td.length; l++) {
			if(Td[l]>1) {
				f=true;
			}
		}
		if(f) {
			System.out.println("");
		}
		else {
	System.out.println(HoldZirBaze[0]);
		}
	}
		
}
