#include <bits/stdc++.h>
using namespace std;
using P = pair<int, string>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  map<string, int> mp;
  for (int i = 0; i < (n - 1); ++i) mp[s.substr(i, 2)]++;
  P ans;
  for (auto &[t, x] : mp) ans = max(ans, {x, t});
  cout << ans.second << '\n';
  return 0;
}
