#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, chk = 0;
  cin >> a;
  string s, ans, s1, s2, t;
  cin >> s;
  map<string, int> m;
  map<string, int>::iterator it;
  vector<pair<int, string> > v;
  vector<int> v1;
  vector<string> v2;
  for (int i = 0; i < s.length(); i++) {
    t = s[i];
    m[t]++;
  }
  for (it = m.begin(); it != m.end(); it++) {
    v.push_back(make_pair(it->second, it->first));
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    v1.push_back(v[i].first);
    v2.push_back(v[i].second);
  }
  int tt, porerta, ch1, pk = 0;
  for (int i = 0; i < v1.size(); i++) {
    tt = v1[i] - chk;
    s1 = v2[i];
    for (int j = 0; j < tt; j++) {
      ans += s1;
    }
  }
  cout << ans;
}
