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 <typename T>
void read(vector<T> &a) {
  for (long long int i = 0; i < (long long int)(a).size(); i++) cin >> a[i];
}
template <typename T>
void write(vector<T> a, long long int start = 0) {
  for (long long int i = start; i < (long long int)(a).size(); i++)
    cout << a[i] << ' ';
  cout << '\n';
}
long long int primes[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29, 31, 37,
                          41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89};
string alpha = "abcdefghijklmnopqrstuvwxyz";
void solve() {
  string s, ans = "";
  long long int n, mx = 0;
  cin >> n >> s;
  map<string, long long int> mp;
  for (long long int i = 0; i < n - 1; i++) {
    string ch = "";
    ch += s[i], ch += s[i + 1];
    if (mp[ch] == 0)
      mp[ch] = 1;
    else
      mp[ch]++;
    if (mx < mp[ch]) {
      mx = mp[ch];
      ans = ch;
    }
  }
  cout << ans << '\n';
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int t = 1;
  for (long long int i = 1; i <= t; ++i) {
    solve();
  }
}
