#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, max_index, max_count = 0;
  cin >> n;
  char* arr = new char[n];
  cin >> arr;
  for (int i = 1; i < n; i++) {
    int count = 1;
    for (int j = i + 1; j < n; j++) {
      if (arr[i] == arr[j] && arr[i - 1] == arr[j - 1]) count++;
    }
    if (count > max_count) {
      max_count = count;
      max_index = i;
    }
  }
  cout << arr[max_index - 1] << arr[max_index] << endl;
  return 0;
}
