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


//..............Learning.........//



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

public class A {

static FastReader		sc	= new FastReader();
static PrintWriter	out	= new PrintWriter(System.out);

public static void main(String[] args) throws Exception {
//	try {
//
	int t = 1;
	while (t-- > 0)
		A.go();
	out.flush();
//	} catch (Exception e) {
//		return;
//	}
}


static HashSet<Integer>	set		= new HashSet<Integer>();

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Code Starts <<<<<<<<<<<<<<<<<<<<<<<<<<<<< //

static void go() {
int n=sc.nextInt();
String s=sc.next();
HashMap<String,Integer> map=new HashMap<>();
int max=Integer.MIN_VALUE;
String ans="";
for(int i=0;i<n-2;i++) {
	String ss=s.substring(i,i+2);
	map.put(ss,map.getOrDefault(ss,0)+1);
	for(String j:map.keySet()) {
		if(map.get(j)>max) {
			max=map.get(j);
			ans=j;
		}
	}
}
out.println(ans);
}


//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Code Ends <<<<<<<<<<<<<<<<<<<<<<<<<<<<< //

static long gcd(long a, long b) {
	if (b==0) {
		return a;
	}return gcd(b, a%b);
}
static int	prime[]	= new int[200005];
static int	N				= 200005;
static void sieve() {

	for(int i=0;i<N;i++) {
		prime[i]=i;
}
	for (int i = 2; i * i <= N; i++) {
		if (prime[i] == i) {
			prime[i]=i;
			for (int j = i; j < N; j += i) {
				prime[j] =i;
			}}}
}


static int gcd(int a, int b) {
	if (b == 0) {
		return a;
	}return gcd(b, a % b);
}
 static void sort(int[] a) {
	ArrayList<Integer> aa = new ArrayList<>();
	for (Integer i : a) {
		aa.add(i);	}
	Collections.sort(aa);
	for (int i = 0; i < a.length; i++)
		a[i] = aa.get(i);}
static void sort(long[] a) {
	ArrayList<Long> aa = new ArrayList<>();
	for (Long i : a) {
		aa.add(i);}
	Collections.sort(aa);
	for (int i = 0; i < a.length; i++)
		a[i] = aa.get(i);
}

static int mod = (int) 1e9 + 7;

static long pow(long x, long y) {
	long res = 1l;
	while (y != 0) {
		if (y % 2 == 1) {
			res = (x * res);
			}	y /= 2;x = (x * x);
	}
	return res;
}


//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Fast IO <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< //

static class FastReader {
	BufferedReader	br;
	StringTokenizer	st;
	public FastReader() {
		br = new BufferedReader(new InputStreamReader(System.in));
	}		String next() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}		}	return st.nextToken();
	}	int nextInt() {
		return Integer.parseInt(next());
	}	long nextLong() {
		return Long.parseLong(next());
	}	double nextDouble() {
		return Double.parseDouble(next());
	}		String nextLine() {
		String str = "";
		try {
			str = br.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return str;
	}	}}

class time{
int a;int d;
time(int a,int d ){
	this.a=a;this.d=d;
}

}