#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<string> v;
  int mm = 0, max = 0;
  for (int i = 0; i < n - 1; i++) v.push_back(s.substr(i, 2));
  sort(v.begin(), v.end());
  string s1 = v[0];
  for (int i = 0; i < n - 1; i++) {
    if (v[i] == v[i + 1])
      mm++;
    else {
      if (mm > max) {
        max = mm;
        s1 = v[i - 1];
      }
      mm = 0;
    }
  }
  cout << s1 << "\n";
  ;
}
