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;
const int MOD = 1e9 + 7;
const int MAX = 1e5 + 5;
const double PI = acos(-1.0);
const long double EPS = 1e-10;
const int64_t INF = 1e18 + 10;
template <typename t>
t lcm(t a, t b) {
  return (a * b) / __gcd(a, b);
}
template <typename t>
t gcd(t a, t b) {
  return __gcd(a, b);
}
template <typename t>
t mul_mod(t a, t b, t m) {
  t res = ((a % m) * (b % m) % m);
  return res;
}
template <typename t>
t add_mod(t a, t b, t m) {
  t res = ((a % m) + (b % m)) % m;
  return res;
}
template <typename t>
t pow_mod(t a, t b, t m) {
  t res = 1;
  while (b) {
    if (b & 1) res = mul_mod(res, a, m);
    a = mul_mod(a, a, m), b >>= 1;
  }
  return res % m;
}
template <typename t>
vector<t> num_vec(t num) {
  t res;
  while (num) res.push_back(num % 10), num /= 10;
  return res;
}
template <typename t>
t vec_num(t vec) {
  t res = 0;
  long long mul = 1;
  for (long long i = 0; i < (int)vec.size(); i++) res = vec[i] * mul, mul *= 10;
  return res;
}
int countStrings(string s, string p) {
  int cnt = 0;
  for (long long i = 0; i < (int)s.size(); i++) {
    bool mtc = true;
    if (i + (int)p.size() < (int)s.size()) {
      for (long long j = 0; j < (int)p.size(); j++) {
        if (s[i + j] != p[j]) {
          mtc = false;
          break;
        }
      }
      cnt += mtc;
    }
  }
  return cnt;
}
int32_t main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  auto tstart = clock();
  int n;
  cin >> n;
  string s;
  cin >> s;
  map<string, int> cnt;
  for (long long i = 0; i < 26; i++) {
    string st = string(1, (char)(i + 'A'));
    for (long long j = 0; j < 26; j++) {
      st += (char)(j + 'A');
      cnt[st] = countStrings(s, st);
      st = string(1, (char)(i + 'A'));
    }
  }
  int mx = -1;
  string ans = "";
  for (auto i : cnt)
    if (i.second > mx) ans = i.first, mx = i.second;
  cout << ans << endl;
  cerr << setprecision(2) << fixed
       << "Time elapsed: " << (double)(clock() - tstart) / CLOCKS_PER_SEC
       << endl;
  return 0;
}
