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