#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, t, p = 0, q = 0, l = 0, r, n;
  cin >> n;
  string s, s1, s2;
  cin >> s;
  map<string, int> m;
  if (n == 2) {
    cout << s;
  } else if (n == 3) {
    cout << s[0] << s[1];
  } else if (n != 2 || n != 3) {
    for (i = 0; i < n; i++) {
      m[s.substr(i, 2)]++;
    }
    map<string, int>::iterator it = m.begin();
    for (it = m.begin(); it != m.end(); it++) {
      if (it->second > p) {
        p = it->second;
        s2 = it->first;
      }
    }
    cout << s2;
  }
  return 0;
}
