#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int n = 0;
  cin >> n;
  string s;
  cin >> s;
  map<string, long long int> answers;
  for (long long int i = 0; i < n - 1; ++i) ++answers[s.substr(i, 2)];
  long long int max_cnt = 0;
  string max_ans;
  for (const auto &[key, val] : answers) {
    if (val > max_cnt) {
      max_cnt = val;
      max_ans = key;
    }
  }
  cout << max_ans;
}
