#include <bits/stdc++.h>
using namespace std;
bool compare(const pair<long long, long long> &a,
             const pair<long long, long long> &b) {
  return (a.second < b.second);
}
vector<long long> subseg(vector<long long> v) {
  long long n = v.size(), i = 0;
  vector<long long> res(n + 1, 0);
  while (i < n) {
    if (v[i] == 0) {
      i++;
      continue;
    }
    long long j = i;
    while (j < n and v[j] == 1) {
      j++;
    }
    for (int k = 1; k <= j - i; k++) {
      res[k] += j - i - k + 1;
    }
    i = j;
  }
  return res;
}
vector<bool> PRIME(1000005, true);
void sieve(long long n) {
  PRIME[0] = false;
  PRIME[1] = false;
  for (long long p = 2; p * p <= n; p++) {
    if (PRIME[p] == true) {
      for (long long i = p * p; i <= n; i += p) {
        PRIME[i] = false;
      }
    }
  }
}
long long a, b, c, d, e, m, n, p, x, y, z, mn, mx;
long long arr[10000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  while (t--) {
    cin >> n;
    string s, str;
    cin >> s;
    map<string, long long> my;
    for (int i = 0; i < n - 1; i++) {
      str = s.substr(i, 2);
      my[str]++;
    }
    mx = -1;
    for (auto it : my) {
      str = it.first;
      if (mx < it.second) {
        mx = it.second;
        s = it.first;
      }
    }
    cout << s;
  h:;
    cout << "\n";
  }
  return 0;
}
