#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, b[100] = {0}, c, ma, j, n;
  char s[105];
  cin >> n;
  cin >> s;
  for (i = 0; i < n - 1; i++) b[i] = 0;
  for (i = 0; i < n - 1; i++) {
    for (j = i + 1; j < n - 1; j++)
      if (s[j] == s[i] && s[j + 1] == s[i + 1]) b[i] = b[i] + 1;
  }
  ma = b[0];
  c = 0;
  for (i = 0; i < n - 1; i++)
    if (b[i] > ma) {
      c = i;
      ma = b[i];
    }
  cout << s[c] << s[c + 1];
}
