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;
vector<long long> v[100000 + 1];
bool vis[100000 + 1] = {false};
double mod(double a, double b) { return a - (long long)(a / b) * b; }
double gcd(double x, double y) {
  if (y <= 0.0001) return x;
  return gcd(y, mod(x, y));
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  long long max = -1e9;
  cin >> n;
  string s, s1 = {};
  char c1, c2;
  cin >> s;
  for (long long i = 0; i < n - 1; i++) {
    long long x = 1;
    for (long long j = i + 1; j < n - 1; j++) {
      if (s[j] == s[i] && s[j + 1] == s[i + 1]) x++;
    }
    if (x > max) max = x, c1 = s[i], c2 = s[i + 1];
  }
  cout << c1 << c2;
  return 0;
}
