#include <bits/stdc++.h>
using namespace std;
char a[105];
int f[50000];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", a);
  memset(f, 0, sizeof(f));
  int ma = 0;
  char f1, f2;
  for (int i = 1; i < strlen(a); i++) {
    f[(a[i - 1] - 50) * 100 + a[i] - 50]++;
    if (f[(a[i - 1] - 50) * 100 + a[i] - 50] > ma) {
      ma = f[(a[i - 1] - 50) * 100 + a[i] - 50];
      f1 = a[i - 1];
      f2 = a[i];
    }
  }
  printf("%c%c\n", f1, f2);
}
