#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  map<string, long long> mp;
  long long n;
  cin >> n;
  string s;
  cin >> s;
  for (long long i = 0; i < n - 1; i++) {
    mp[s.substr(i, 2)]++;
  }
  long long mx = 0;
  for (auto p : mp) mx = max(mx, p.second);
  for (auto p : mp) {
    if (mx == p.second) {
      cout << p.first;
      return 0;
    }
  }
  return 0;
}
