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 main() {
  int t;
  string s, s1;
  cin >> t >> s;
  std::unordered_map<string, int> mymap;
  std::unordered_map<string, int>::iterator it;
  for (int i = 0; i < t - 1; i++) {
    int a = s[i] - '0';
    int b = s[i + 1] - '0';
    s1 = "";
    if (abs(a - b) == 0 || abs(a - b) == 1 || abs(a - b) == 25) {
      char c = s[i];
      s1 = c;
      c = s[i + 1];
      s1 = s1 + c;
      it = mymap.find(s1);
      if (it != mymap.end()) {
        mymap[s1] = mymap.find(s1)->second + 1;
      } else {
        mymap[s1] = 1;
      }
    }
  }
  int m = 0;
  for (it = mymap.begin(); it != mymap.end(); ++it) {
    if (it->second > m) {
      s1 = it->first;
    }
  }
  cout << s1;
  return 0;
}
