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>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-O3")
using namespace std;
mt19937 gen(chrono::system_clock::now().time_since_epoch().count());
const long long N = 2e5 + 32;
const long long M = 1e9 + 7;
const long long mod = 998244353;
const long long rx[4] = {0, 0, -1, 1};
const long long ry[4] = {-1, 1, 0, 0};
const double pi = acos(-1.0);
const long long kx[8] = {1, 1, -1, -1, 2, 2, -2, -2};
const long long ky[8] = {2, -2, 2, -2, 1, -1, 1, -1};
const long long MAXLL = 9223372036854775258LL;
const long long MAXINT = 21473098;
void solve() {
  long long n;
  cin >> n;
  string a;
  cin >> a;
  map<string, long long> m;
  for (long long i = 0; i < n - 1; ++i) {
    string s = "";
    s += a[i];
    s += a[i + 1];
    m[s]++;
  }
  long long ans = 0;
  string an;
  for (auto i : m) {
    if (i.second > ans) {
      ans = i.second;
      an = i.first;
    }
  }
  cout << an << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q;
  q = 1;
  while (q--) solve();
  return 0;
}
