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;
long long MOD = 1000000007;
vector<int> adj[1005];
bool check(long long n) {
  for (long long i = 2; i * i <= n; i++) {
    if ((n % i) == 0) return false;
  }
  return true;
}
long long get(long long n) {
  for (int i = 2; i <= n; i++)
    if (n % i == 0) return i;
}
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  unordered_map<string, int> m;
  for (int i = 0; i < s.length(); i++) {
    m[s.substr(i, 2)]++;
  }
  string ans;
  int mx = 0;
  for (auto x : m) {
    string str = x.first;
    if (str.length() == 2) {
      int check = (int)str[0] - (int)str[1];
      if (x.second > mx) {
        ans = x.first;
        mx = max(mx, x.second);
      }
    }
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
