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

public class Main {
	private static ArrayList<String> a;
	private static Scanner in=new Scanner(new BufferedInputStream(System.in));
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int n=in.nextInt();
		a=new ArrayList<>();
		String s=in.next();
		for(int i=2;i<=n;i++) {
			a.add(s.substring(i-2,i));
		}
		Collections.sort(a);
		int t=1;
		s=a.get(0);
		int sum=1;
		String ans=s;
		n=a.size();
		for(int i=1;i<n;i++) {
			if(s.equals(a.get(i))) {
				t++;
			}
			else {
				if(t>sum) {
					sum=t;
					ans=s;
				}
				s=a.get(i);
				t=1;
			}
		}
		if(t>sum) {
			sum=t;
			ans=s;
		}
		System.out.println(ans);
	}
}