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>
int sum(char b[][2], char m, char n, int k) {
  int i, sum = 0;
  for (i = 0; i < k; i++) {
    if (b[i][0] == m && b[i][1] == n) sum++;
  }
  return (sum);
}
int main() {
  int i = 0, j, n, length, k, l = 0, m, max = 0, a[100];
  char s[100], b[100][2];
  scanf("%d", &n);
  getchar();
  gets(s);
  length = strlen(s);
  for (j = 0; j < length - 1; j++) {
    for (k = 0; k < 2; k++) {
      b[j][k] = s[i++];
    }
    i--;
  }
  for (j = 0; j < i - 1; j++) a[l++] = sum(b, b[j][0], b[j][1], i - 1);
  for (j = 0; j < l; j++) {
    if (a[j] >= max) {
      max = a[j];
      m = j;
    }
  }
  printf("%c%c", b[m][0], b[m][1]);
  return 0;
}
