#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int t;
  cin >> t;
  cin >> s;
  int sum = 0, f, n = 0;
  for (int i = 0; i < s.length() - 2; i++) {
    f = 0;
    string s1 = "";
    s1 = s1 + s[i] + s[i + 1];
    for (int j = i + 1; j < s.length() - 1; j++) {
      string s2 = "";
      s2 = s2 + s[j] + s[j + 1];
      if (s1 == s2) {
        f++;
      }
    }
    if (sum < f) {
      sum = f;
      n = i;
    }
  }
  cout << s[n] << s[n + 1];
}
