#include <bits/stdc++.h>
using namespace std;
int n, maxx;
string s, max_two_gram;
unordered_map<string, int> two_gram;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n - 1; i++) {
    two_gram[s.substr(i, 2)]++;
  }
  for (auto i : two_gram) {
    if (i.second > maxx) {
      maxx = i.second;
      max_two_gram = i.first;
    }
  }
  cout << max_two_gram;
  return 0;
}
