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() {
  int n, cnt, res;
  string str;
  int i, j;
  char a, b, n_a, n_b;
  while (cin >> n) {
    cnt = 0;
    res = 0;
    cin >> str;
    int l = str.size();
    for (i = 0; i < l - 1; i++) {
      cnt = 0;
      a = str[i];
      b = str[i + 1];
      for (j = i + 1; j < l - 1; j++) {
        if (a == str[j] && b == str[j + 1]) {
          cout << a << b << endl;
          cnt++;
        }
      }
      if (cnt >= res) {
        res = cnt;
        n_a = a;
        n_b = b;
      }
    }
    cout << n_a << n_b << endl;
  }
  return 0;
}
