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() {
  long long i, j, k, t, p = 0, q = 0, l = 0, r, n;
  cin >> n;
  string s, s1, s2;
  cin >> s;
  map<string, int> m;
  if (n == 2) {
    cout << s;
  } else if (n == 3) {
    cout << s[0] << s[1];
  } else if (n != 2 || n != 3) {
    for (i = 0; i < n; i++) {
      m[s.substr(i, 2)]++;
    }
    map<string, int>::iterator it = m.begin();
    for (it = m.begin(); it != m.end(); it++) {
      if (it->second > p) {
        p = it->second;
        s2 = it->first;
      }
    }
    cout << s2;
  }
  return 0;
}
