#include <bits/stdc++.h>
using namespace std;
int n;
char s[111];
void input();
void solve();
int main() {
  input();
  solve();
}
void input() { cin >> n >> s; }
void solve() {
  char ans[2];
  int mnum = 0;
  for (int i = 0; i < n - 1; i++) {
    int num = 0;
    for (int j = 0; j < n - 1; j++) {
      if (s[i] == s[j] && s[i + 1] == s[j + 1]) {
        num++;
      }
    }
    if (mnum <= num) {
      mnum = num;
      ans[0] = s[i];
      ans[1] = s[i + 1];
    }
  }
  cout << ans[0] << ans[1];
}
