#include <bits/stdc++.h>
using namespace std;
vector<long long> v[100000 + 1];
bool vis[100000 + 1] = {false};
double mod(double a, double b) { return a - (long long)(a / b) * b; }
double gcd(double x, double y) {
  if (y <= 0.0001) return x;
  return gcd(y, mod(x, y));
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  long long max = -1e9;
  cin >> n;
  string s, s1 = {};
  char c1, c2;
  cin >> s;
  for (long long i = 0; i < n - 1; i++) {
    long long x = 1;
    for (long long j = i + 1; j < n - 1; j++) {
      if (s[j] == s[i] && s[j + 1] == s[i + 1]) x++;
    }
    if (x > max) max = x, c1 = s[i], c2 = s[i + 1];
  }
  cout << c1 << c2;
  return 0;
}
