#include <bits/stdc++.h>
using namespace std;
int kmp(char *s, char *t, int next[]) {
  int ans = 0;
  int i, j;
  i = 0;
  j = 0;
  int slen = strlen(s);
  while (i < slen) {
    if (j == -1 || s[i] == t[j]) {
      i++;
      j++;
    } else
      j = next[j];
    if (j == 2) {
      ans++;
      j = 0;
      i = i - 1;
    }
  }
  return ans;
}
int main() {
  int n;
  int next[2];
  char a[105];
  char b[2];
  char c[2];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int k = 0;
  c[0] = a[0];
  c[1] = a[1];
  next[0] = -1;
  next[1] = 0;
  for (int i = 0; i < n - 1; i++) {
    b[0] = a[i];
    b[1] = a[i + 1];
    if (k < kmp(a, b, next)) {
      c[0] = b[0];
      c[1] = b[1];
      k = kmp(a, b, next);
    }
  }
  cout << c[0] << c[1];
  return 0;
}
