#include <bits/stdc++.h>
using namespace std;
int n;
string s;
int cal(int idx) {
  char now[2] = {s[idx], s[idx + 1]};
  int count = 0;
  for (int i = idx; i < n - 1; i++) {
    if ((s[i] == now[0]) && (s[i + 1] == now[1])) {
      count++;
    }
  }
  return count;
}
int main() {
  scanf("%d", &n);
  cin >> s;
  int max = 0;
  int ans;
  for (int i = 0; i < n - 1; i++) {
    int count = cal(i);
    if (max < count) {
      max = count;
      ans = i;
    }
  }
  for (int i = 0; i < 2; i++) {
    printf("%c", s[ans + i]);
  }
}
