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;
namespace mod {
long long const modul = 1000000009;
long long sum(long long x, long long y) { return (x + y) % modul; }
long long sub(long long x, long long y) {
  if (x > y) {
    return (x - y) % modul;
  } else {
    return (modul + x - y) % modul;
  }
}
long long mpl(long long x, long long y) { return (x * y) % modul; }
long long bin_pow(long long x, long long e) {
  long long ans = 1;
  while (e) {
    if (e & 1) {
      ans = mod::mpl(ans, x);
    }
    x = mod::mpl(x, x);
    e >>= 1;
  }
  return ans;
}
long long rev(long long x) {
  long long ans = bin_pow(x, modul - 2);
  return ans;
}
long long div(long long x, long long y) {
  assert(y != 0);
  long long ans = x;
  ans = mod::mpl(ans, mod::rev(y));
  return ans;
}
}  // namespace mod
void set_precise(int n) {
  cout << fixed;
  cout << setprecision(n);
}
vector<string> v;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n - 1; ++i) {
    string t = "";
    t.push_back(s[i]);
    t.push_back(s[i + 1]);
    v.push_back(t);
  }
  sort(v.begin(), v.end());
  string ans = "";
  int ans_cnt = 0;
  int cnt = 0;
  for (int i = 0; i < v.size() + 1; ++i) {
    if ((i == v.size()) || (i == 0) || (v[i] != v[i - 1])) {
      if (cnt > ans_cnt) {
        ans_cnt = cnt;
        ans = v[i - 1];
      }
      cnt = 1;
    } else {
      ++cnt;
    }
  }
  cout << ans;
  return 0;
}
