#include <bits/stdc++.h>
using namespace std;
const int maxn = 107;
char str[maxn];
int main() {
  int n;
  cin >> n;
  cin >> str;
  map<string, int> mp;
  int maxx = 0;
  string ans;
  for (int i = 0; i < n - 1; i++) {
    string s;
    s += str[i];
    s += str[i + 1];
    mp[s]++;
    if (mp[s] > maxx) {
      maxx = mp[s];
      ans = s;
    }
  }
  cout << ans << endl;
  return 0;
}
