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;
bool compare(const pair<long long, long long> &a,
             const pair<long long, long long> &b) {
  return (a.second < b.second);
}
vector<long long> subseg(vector<long long> v) {
  long long n = v.size(), i = 0;
  vector<long long> res(n + 1, 0);
  while (i < n) {
    if (v[i] == 0) {
      i++;
      continue;
    }
    long long j = i;
    while (j < n and v[j] == 1) {
      j++;
    }
    for (int k = 1; k <= j - i; k++) {
      res[k] += j - i - k + 1;
    }
    i = j;
  }
  return res;
}
vector<bool> PRIME(1000005, true);
void sieve(long long n) {
  PRIME[0] = false;
  PRIME[1] = false;
  for (long long p = 2; p * p <= n; p++) {
    if (PRIME[p] == true) {
      for (long long i = p * p; i <= n; i += p) {
        PRIME[i] = false;
      }
    }
  }
}
long long a, b, c, d, e, m, n, p, x, y, z, mn, mx;
long long arr[10000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  while (t--) {
    cin >> n;
    string s, str;
    cin >> s;
    map<string, long long> my;
    for (int i = 0; i < n - 2; i++) {
      str = s.substr(i, 2);
      my[str]++;
    }
    mx = -1;
    for (auto it : my) {
      str = it.first;
      if ((str[0] == str[1] or abs(str[0] - str[1]) == 1 or
           abs(str[0] - str[1]) == 1) and
          mx < it.second) {
        mx = it.second;
        s = it.first;
      }
    }
    cout << s;
  h:;
    cout << "\n";
  }
  return 0;
}
