#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<string> v;
  for (int i = 0; i < n - 1; i++) {
    string ss;
    ss += s[i];
    ss += s[i + 1];
    v.push_back(ss);
  }
  int sz = v.size();
  map<string, int> mp;
  for (int i = 0; i < sz; i++) {
    mp[v[i]]++;
  }
  map<string, int>::iterator it = mp.begin();
  string ans;
  int mx = 0;
  for (; it != mp.end(); it++) {
    int cnt = it->second;
    if (cnt > mx) {
      ans = it->first;
      mx = it->second;
    }
  }
  cout << ans;
  return 0;
}
