#include <bits/stdc++.h>
int main() {
  int n, i, j, b, count, a = 0;
  scanf("%d", &n);
  char str[n + 5];
  scanf("%s", str);
  for (i = 0; i < n - 1; i++) {
    count = 0;
    for (j = 0; j < n - 1; j++) {
      if ((str[i] == str[j]) && (str[i + 1] == str[j + 1])) count++;
    }
    if (count > a) {
      a = count;
      b = i;
    }
  }
  printf("%c%c", str[b], str[b + 1]);
  return 0;
}
