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 n, m = 0;
  bool flag;
  string s, s1, s2;
  cin >> n;
  cin >> s;
  vector<pair<string, int>> v;
  for (int i = 0; i < s.size() - 1; i++) {
    flag = false;
    s1 = s[i];
    s2 = s[i + 1];
    s1 += s2;
    for (int j = 0; j < i; j++) {
      if (s1 == v[j].first) {
        v[j].second++;
        flag = true;
        if (v[j].second > m) m = v[j].second;
      }
    }
    if (flag != true) {
      v.push_back(make_pair(s1, 1));
    }
  }
  for (int i = 0; i < v.size(); i++) {
    if (v[i].second == m) {
      cout << v[i].first << endl;
      break;
    }
  }
  return 0;
}
