#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, hit = 0;
  string str, ans;
  cin >> a;
  cin >> str;
  for (int i = 1; i < a; i++) {
    int hii = 0;
    string b;
    b = b + str[i - 1] + str[i];
    for (int j = i + 1; j < a; j++) {
      string c;
      c = c + str[j - 1] + str[j];
      if (c == b) hii++;
    }
    if (hit <= hii) {
      ans = b;
      hit = hii;
    }
  }
  cout << ans;
}
