#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  while (cin >> n >> s) {
    int m = 0;
    string result;
    for (int i = 0; i < n - 1; i++) {
      string sub(s, i, 2);
      int cnt = 0;
      for (int j = 0; j < n - 1; j++) {
        if (s[j] == sub[0] && s[j + 1] == sub[1]) cnt += 1;
      }
      if (cnt > m) {
        m = cnt;
        result = sub;
      }
    }
    cout << result << endl;
  }
  return 0;
}
