#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  map<string, int> m;
  for (int i = 0; i < n; i++) {
    if (i + 1 < n) {
      string s1 = "";
      s1 += s[i];
      s1 += s[i + 1];
      m[s1]++;
    }
  }
  auto it = m.begin();
  string ans = "";
  int c = 0;
  while (it != m.end()) {
    int cnt = it->second;
    if (cnt > c) {
      c = cnt;
      ans = it->first;
    }
    it++;
  }
  cout << ans << endl;
  return 0;
}
