#include <bits/stdc++.h>
using namespace std;
int main() {
  int no, maxvar = INT_MIN, cnt = 0;
  string s, s2;
  cin >> no;
  cin >> s;
  for (int i = 0; i < s.length() - 1; i++) {
    string s1 = s.substr(i, 2);
    cnt = 0;
    for (int j = 0; j < s.length() - 1; j++) {
      if (s1[0] == s[j] && s1[1] == s[j + 1]) {
        cnt++;
      }
      if (cnt > maxvar) {
        maxvar = cnt;
        s2 = s1;
      }
    }
  }
  cout << s2;
}
