#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, ans = 0;
  cin >> n;
  string s, x = "";
  cin >> s;
  map<string, long long int> m;
  for (long long int i = 0; i < n - 1; i++) {
    m[s.substr(i, 2)]++;
  }
  for (auto i : m) {
    ans = max(ans, i.second);
    if (ans == i.second) x = i.first;
  }
  cout << x << endl;
  return 0;
}
