#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  string s;
  cin >> s;
  map<string, int> cnt;
  string ans;
  for (int i = 0; i < n - 1; i++) {
    ans = s[i];
    ans += s[i + 1];
    cnt[ans]++;
  }
  int c = 0;
  for (auto i : cnt) {
    if (i.second > c) {
      c = i.second;
      ans = i.first;
    }
  }
  cout << ans;
  return 0;
}
