#include <bits/stdc++.h>
using namespace std;
int n;
string s, t;
string ans;
int anst, tmp;
int main() {
  cin >> n >> s;
  tmp = -1;
  for (int i = 0; i < n - 1; i++) {
    int cnt = 0;
    t = s.substr(i, 2);
    for (int j = 0; j < n - 1; j++) {
      if (t[0] == s[j] && t[1] == s[j + 1]) cnt++;
    }
    if (cnt > tmp) {
      ans = t;
      tmp = cnt;
    }
  }
  cout << ans << endl;
  return 0;
}
