#include <bits/stdc++.h>
using namespace std;
const int MAX = 200100;
int main() {
  int n, cnt = 0, maxCnt = -1;
  string s, t, tt, ans;
  cin >> n >> s;
  for (int i = 0; i < n - 1; i++) {
    t = s[i];
    t += s[i + 1];
    cnt = 0;
    for (int j = i + 1; j < n - 1; j++) {
      tt = s[j];
      tt += s[j + 1];
      if (t == tt) {
        ++cnt;
      }
    }
    if (cnt > maxCnt) {
      ans = t;
      maxCnt = cnt;
    }
  }
  cout << ans << endl;
}
