#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 0, f, j, a[100] = {0}, k = 0, r, c = 0;
  string s, s1[100];
  cin >> t >> s;
  for (f = 0; f < t - 1; f++) {
    for (c = 0; c < 2; c++) s1[f] += s[c + f];
  }
  for (f = 0; f < t - 1; f++)
    for (j = t - 2; f <= j; j--)
      if (s1[f] == s1[j]) a[f]++;
  for (f = 0; f < t - 1; f++)
    if (k < a[f]) {
      k = a[f];
      r = f;
    }
  cout << s1[r];
}
