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;
const double pi = acos(-1.0);
template <typename T, typename U>
inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
inline void amax(T &x, U y) {
  if (x < y) x = y;
}
template <typename T>
inline void write(std::vector<T> list) {
  std::stringstream S;
  for (const T &t : list) {
    S << t;
    S << " ";
  }
  std::cout << S.str();
}
template <typename T>
inline void read(int n, std::vector<T> &list) {
  std::string input;
  std::getline(std::cin, input);
  std::stringstream stream(input);
  T temp;
  while (n > 0) {
    stream >> temp;
    if (!stream) break;
    list.push_back(temp);
    --n;
  }
}
int main() {
  std::vector<std::string> twograms;
  string test, res, S;
  long long int max = 0;
  cin >> max;
  max = 0;
  cin >> test;
  for (int i = 0; i < test.size() - 1; ++i) {
    S = test.substr(i, 2);
    if (std::find(twograms.begin(), twograms.end(), S) == twograms.end()) {
      twograms.push_back(S);
      long long int count = 0;
      size_t nPos = test.find(S, 0);
      while (nPos != string::npos) {
        count++;
        nPos = test.find(S, nPos + 1);
      }
      if (count > max) {
        max = count;
        res = S;
      }
    }
  }
  cout << res;
  return 0;
}
