#include <bits/stdc++.h>
using namespace std;
string n, m;
int a, res, sum;
char h, k, hres, kres;
int main() {
  cin >> a;
  cin >> n;
  res = 0;
  for (int i = 0; i <= a - 2; i++) {
    h = n[i];
    k = n[i + 1];
    sum = 0;
    for (int j = 0; j <= a - 2; j++) {
      if (((h == n[j]) && (k == n[j + 1]))) sum++;
    }
    if (sum > res) {
      res = sum;
      hres = h;
      kres = k;
    }
  }
  cout << hres << kres;
  return 0;
}
