#include <bits/stdc++.h>
int main() {
  using std::cin;
  using std::cout;
  using std::endl;
  using std::ios_base;
  using std::string;
  using std::unordered_map;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  string str;
  cin >> n;
  cin >> str;
  unordered_map<string, int> umap;
  for (int i = 0; i < n - 1; i++) {
    umap[string(1, str[i]) + str[i + 1]]++;
  }
  int max = 0;
  string ans;
  for (auto &el : umap) {
    if (el.second > max) {
      ans = el.first;
      max = el.second;
    }
  }
  cout << ans << endl;
  return 0;
}
