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

#include <bits/stdc++.h>
using namespace std;
int kmp(char *s, char *t, int next[]) {
  int ans = 0;
  int i, j;
  i = 0;
  j = 0;
  int slen = strlen(s);
  while (i < slen) {
    if (j == -1 || s[i] == t[j]) {
      i++;
      j++;
    } else
      j = next[j];
    if (j == 2) {
      ans++;
      j = 0;
      i = i - 1;
    }
  }
  return ans;
}
int main() {
  int n;
  int next[2];
  char a[105];
  char b[2];
  char c[2];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int k = 0;
  c[0] = a[0];
  c[1] = a[1];
  next[0] = -1;
  next[1] = 0;
  for (int i = 0; i < n - 1; i++) {
    b[0] = a[i];
    b[1] = a[i + 1];
    if (k < kmp(a, b, next)) {
      c[0] = b[0];
      c[1] = b[1];
      k = kmp(a, b, next);
    }
  }
  cout << c[0] << c[1];
  return 0;
}
