#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, mx = 0;
  string s, ans = "";
  cin >> n;
  cin >> s;
  for (int i = 0; i < n - 1; i++) {
    string res = "";
    int c = 0;
    res = s[i];
    res += s[i + 1];
    for (int j = 0; j < n; j++) {
      if (res[0] == s[j] && res[1] == s[j + 1]) c++;
    }
    if (c > mx) {
      mx = c;
      ans = res;
    }
  }
  cout << ans;
}
