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 cur, goal, q, cnt;
void rec(int n, int v) {
  if (n == q) {
    if (v == goal) cnt++;
    return;
  }
  rec(n + 1, v + 1);
  rec(n + 1, v - 1);
}
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n;
  cin >> s;
  map<string, int> m;
  for (int i = 1; i < n; i++) {
    string tmp = s.substr(i - 1, 2);
    if (m[tmp])
      m[tmp]++;
    else
      m[tmp] = 1;
  }
  string ans = "";
  int t = 0;
  for (std::map<string, int>::iterator it = m.begin(); it != m.end(); it++) {
    if (it->second >= t) {
      t = it->second;
      ans = it->first;
    }
  }
  cout << ans << endl;
  return 0;
}
