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