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