#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <queue>
#include <numeric>
#include <bitset>
#include <cmath>

using namespace std;
using ll = long long;
// const ll mod =  998244353 ;
const ll mod =  1000000007 ;
const ll inf = 1e18;

#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP_FROM(i, j, n) for (ll i = (j); i < (n); ++i)
#define all(x) (x).begin(),(x).end()
#define sz(x) int(x.size())

template<typename T> void print_vec(vector<T> a) {int n = a.size();REP(i, n) {cout >> a[i]; if(i!=n-1) cout << " "; else cout << endl;}}
ll power(ll base, ll exponent){ if(exponent % 2){ return power(base, exponent - 1) * base % mod; }else if(exponent){ ll root_ans = power(base, exponent / 2); return root_ans * root_ans % mod; }else{ return 1; }}
ll inverse(ll x){ return power(x, mod - 2);}
ll gcd(ll a, ll b) {if(a < b) gcd(b, a);ll r;while(r=a%b) {a=b;b=r;}return b;}
template<typename T> ll sum(T begin, T end) {return accumulate(begin, end, 0ll);}
template<typename T, typename F> ll sum(T begin, T end, F func) {return accumulate(begin, end, 0ll, func);}
struct combination{ vector<ll> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } ll C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };

struct Node {
  int a;
  int b;
  Node *child;
  Node(int _a, int _b) : a(_a), b(_b) {
    child = nullptr;
  }
  Node(int _a, int _b, Node *_child) : a(_a), b(_b), child(_child) {
  }
};

signed main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  map<ll, ll> a;
  REP(i, n) {
    int x;
    cin >> x;
    a[x]++;
  }
  map<ll, ll> b;
  for(auto x : a) {
    b[x.second]++;
  }
  vector<ll> ans;
  int K = n-sum(all(b), [](auto a, auto b) {return a + b.second;}); 
  // cout << "K:" << K << endl;
  REP(i, K) {
    ans.push_back(0);
  }
  REP(k, n-K-1) {
    // for(auto x : b) cout << x.first << ":" << x.second << ", "; cout << endl;
    ll cnt = (*b.begin()).first;
    ans.push_back(cnt);
    b[(*b.begin()).first] -= 1;
    if((*b.begin()).second == 0) {
      b.erase(b.begin());
    }
    while(cnt>0) {
      // cout << "cnt:" << cnt << endl;
      // cout << "sz(b):" << sz(b) << endl;
      if(sz(b) == 1) {
        auto lft = *b.begin();
        int base = cnt / lft.second;
        // cout << "base1:" << base << endl;
        if(cnt % lft.second) {
          b[lft.first+base] = lft.second - cnt % lft.second;
          b[lft.first+base+1] = cnt % lft.second;
        }
        else {
          b[lft.first+base] = lft.second;
        }
        if(base) b.erase(lft.first);
        cnt = 0;
        break;
      }
      auto lft = *b.begin();
      auto rgt = *(++b.begin());
      if((rgt.first - lft.first) * lft.second <= cnt) {
        // cout << "<=cnt" << endl;
        b[rgt.first] += lft.second;
        b.erase(lft.first);
        cnt -= (rgt.first - lft.first) * lft.second;
      }
      else {
        int rest = lft.second;
        int base = cnt / rest;
        // cout << "base2:" << base << endl;
        if(cnt % rest) {
          b[lft.first+base] += rest - cnt % rest;
          b[lft.first+base+1] += cnt % rest;
        }
        else {
          b[lft.first+base] += lft.second;
        }
        b[lft.first] -= rest;
        if(!b[lft.first]) b.erase(lft.first);
        cnt = 0;
      }
    }
  }
  ans.push_back(n);
  reverse(all(ans));
  REP(i, n) cout << ans[i] << endl;
  return 0;
}

Measured memory_bytes: 23792