#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  map<string, int> m;
  int n;
  string s;
  cin >> n >> s;
  for (size_t i = 0; i < s.size() - 1; ++i) m[s.substr(i, 2)]++;
  int maior = 0;
  for (const auto& c : m)
    if (c.second > maior) {
      maior = c.second;
      s = c.first;
    }
  cout << s << endl;
  return 0;
}
