#include <bits/stdc++.h>
int main() {
  char ch[200], s[4];
  int i, n, k = 1, max = 0, j;
  scanf("%d\n", &n);
  gets(ch);
  for (i = 0; i < n; i++) {
    k = 1;
    for (j = 0; j < n; j++) {
      if (j != i) {
        if (ch[i] == ch[j] && ch[i + 1] == ch[j + 1]) {
          k++;
        }
      }
    }
    if (k > max) {
      max = k;
      s[1] = ch[i];
      s[2] = ch[i + 1];
    }
  }
  printf("%c%c\n", s[1], s[2]);
  return 0;
}
