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;
template <template <typename> class Array, typename T>
void outArray(Array<T>& a) {
  auto it = a.begin();
  for (; it != a.end(); it++) {
    cout << (*it) << " ";
  }
  cout << "\n";
}
template <typename T>
void outVector(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i] << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  string ans = "";
  int maxCount = 0;
  for (int i = 1; i < n; i++) {
    int count = 0;
    string temp = "";
    temp.push_back(s[i - 1]);
    temp.push_back(s[i]);
    for (int j = 1; j < n; j++) {
      string cmp = "";
      cmp.push_back(s[j - 1]);
      cmp.push_back(s[j]);
      if (temp == cmp) {
        count++;
      }
    }
    if (count > maxCount) {
      maxCount = count;
      ans = temp;
    }
  }
  cout << ans << "\n";
  return 0;
}
