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;
int main() {
  string s;
  int n, cntr;
  bool check = false;
  cin >> n >> s;
  vector<int> v(n);
  for (size_t i = 0; i < s.size() - 1; i++) {
    if (s[i] != s[i + 1]) {
      check = true;
    }
  }
  if (!check) {
    cout << s[0] << s[1];
    return 0;
  }
  if (n > 2) {
    for (int i = 0; i < s.size() - 2; i++) {
      cntr = 1;
      for (int j = i + 1; j < s.size() - 1; j++) {
        if (s[i] + s[i + 1] == s[j] + s[j + 1]) {
          cntr++;
        }
      }
      v.push_back(cntr);
    }
    int max = v[0];
    for (size_t i = 0; i < v.size(); i++) {
      if (max < v[i]) {
        max = v[i];
      }
    }
    for (size_t i = 0; i < s.size() - 2; i++) {
      cntr = 1;
      for (size_t j = i + 1; j < s.size() - 1; j++) {
        if (s[i] + s[i + 1] == s[j] + s[j + 1]) {
          cntr++;
        }
      }
      if (cntr == max) {
        cout << s[i] << s[i + 1];
        return 0;
      }
    }
  } else {
    cout << s;
  }
}
