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;
void fastIO() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
template <typename T, typename U>
inline void mnze(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
inline void mxze(T &x, U y) {
  if (x < y) x = y;
}
void _scan(int &x) { scanf("%d", &x); }
void _scan(long long &x) { scanf("%lld", &x); }
void _scan(double &x) { scanf("%lf", &x); }
void _scan(long double &x) { scanf("%Lf", &x); }
void _scan(char &x) { scanf(" %c", &x); }
void _scan(char *x) { scanf("%s", x); }
void scan() {}
template <typename T, typename... U>
void scan(T &head, U &...tail) {
  _scan(head);
  scan(tail...);
}
template <typename T>
void _dbg(const char *sdbg, T h) {
  cerr << sdbg << "=" << h << "\n";
}
template <typename T, typename... U>
void _dbg(const char *sdbg, T h, U... t) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, t...);
}
int main() {
  int n, max = 0;
  map<pair<char, char>, int> mp;
  string str;
  cin >> n >> str;
  pair<char, char> aux, ans;
  for (int i = 0; i < n - 2; i++) {
    aux = pair<char, char>(str[i], str[i + 1]);
    mp[aux]++;
    if (mp[aux] > max) {
      max = mp[aux];
      ans = aux;
    }
  }
  cout << ans.first << ans.second;
  return 0;
}
