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 ar[1003] = {0};
int main() {
  long long n, k, ind = 0;
  string s[101];
  string st;
  long long cn[101] = {0};
  char ar[105];
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> ar[i];
    if (i > 0) {
      st = "";
      st = st + ar[i - 1] + ar[i];
    }
    k = 1;
    if (i > 1) {
      for (long long j = 0; j < i - 1; j++) {
        if (st == s[j]) {
          k = 0;
          cn[j]++;
          break;
        }
      }
      if (k) {
        cn[ind]++;
        s[i - 2] = s[i - 2] + st[0] + st[1];
        ind++;
      }
    }
  }
  long long ans = -1;
  long long in = ind;
  for (long long i = 0; i < ind; i++) {
    if (cn[i] >= ans) {
      ans = cn[i];
      ind = i;
    }
  }
  cout << s[ind];
}
