#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  map<string, int> f;
  for (int i = 0; i < n - 1; ++i) f[s.substr(i, 2)]++;
  string ans;
  int times = 0;
  for (auto &x : f)
    if (x.second > times) {
      times = x.second;
      ans = x.first;
    }
  cout << ans << '\n';
}
