#include <bits/stdc++.h>
using namespace std;
map<string, int> m;
string s, c, a;
int n, i, p;
int main() {
  for (cin >> n >> s; i < n - 1; i++) {
    c += s[i];
    c += s[i + 1];
    m[c]++;
    if (p < m[c]) p = m[c], a = c;
    c.clear();
  }
  cout << a;
}
