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