#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c, c1, c2 = -1;
  string s, s1, s2, s3;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    s1 = s.substr(i, 2), c = 0;
    for (int j = i; j < n; j++) {
      s2 = s.substr(j, 2);
      if (s1 == s2) c++;
    }
    if (c > c2) c2 = c, s3 = s1;
  }
  cout << s3 << endl;
}
