#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> mp;
  map<string, int>::iterator it;
  int n;
  cin >> n;
  string arr;
  cin >> arr;
  for (int i = 0; i < n - 1; i++) mp[arr.substr(i, 2)]++;
  int sum = 0;
  string ss;
  for (it = mp.begin(); it != mp.end(); it++)
    if (it->second > sum) {
      sum = it->second;
      ss = it->first;
    }
  cout << ss << endl;
  return 0;
}
