#include <bits/stdc++.h>
using namespace std;
int const M = 2e5 + 10, M2 = 1e6 + 10, mod = 1e9 + 7, inf = 1e9 + 10;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, max = 0;
  cin >> n;
  string s, t, z;
  cin >> s;
  for (long long i = 0; i < n - 1; i++) {
    t = s[i];
    t += s[i + 1];
    long long cnt = 0;
    for (long long m = i; m < n - 1; m++) {
      if (s[m] == t[0] && s[m + 1] == t[1]) {
        cnt++;
      }
    }
    if (cnt > max) {
      max = cnt;
      z = t;
      cnt = 0;
    }
    t.erase(0, 2);
  }
  cout << z;
  return 0;
}
