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() {
  std::ios::sync_with_stdio(false);
  int length;
  string str;
  vector<int> cmpr;
  vector<int> InDefault;
  vector<int> frequen;
  cin >> length >> str;
  if (length == 2) {
    cout << str;
    return 0;
  }
  for (int i = 0; i < length - 2; i++) {
    int temp = (int)str.at(i) * 100 + (int)str.at(i + 1);
    cmpr.push_back(temp);
  }
  cmpr.erase(unique(cmpr.begin(), cmpr.end()), cmpr.end());
  for (int i = 0; i < length - 1; i += 2) {
    int temp = (int)str.at(i) * 100 + (int)str.at(i + 1);
    InDefault.push_back(temp);
  }
  for (int i = 0; i < cmpr.size(); i++) {
    frequen.push_back(0);
    for (int j = 0; j < InDefault.size(); j++) {
      if (cmpr[i] == InDefault[j]) frequen[i]++;
    }
  }
  int maxx = max(frequen[0], frequen[frequen.size() - 1]);
  for (int i = 0; i < frequen.size(); i++) {
    if (frequen[i] == maxx) {
      cout << char(int(cmpr[i] / 100))
           << char(cmpr[i] - int(cmpr[i] / 100) * 100);
      return 0;
    }
  }
  return 0;
}
