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 solve() {
  long long int n, ans = 0;
  cin >> n;
  string s, t;
  cin >> s;
  vector<pair<long long int, long long int> > v;
  for (long long int i = 0; i < n - 1; i += 1) {
    long long int cnt = 0;
    t = s.substr(i, i + 1);
    for (long long int j = i + 1; j < n - 1; j += 1) {
      if (t == s.substr(j, j + 1)) cnt++;
    }
    ans = max(ans, cnt);
    if (cnt == ans) v.push_back(make_pair(cnt, i));
  }
  for (long long int i = 0; i < v.size(); i += 1) {
    if (v[i].first == ans) {
      cout << s[v[i].second] << s[v[i].second + 1];
      break;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    solve();
    cout << '\n';
  }
  return 0;
}
