#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, pos, d;
  friend bool operator<(node a, node b) { return a.pos > b.pos; }
};
priority_queue<node> q;
vector<int> e[100005];
int pin[100005], sum[100005 << 2], a[100005], ans[100005], n;
inline int read() {
  int n = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    n = n * 10 + c - '0';
    c = getchar();
  }
  return n * f;
}
int getpos(int x, int L, int R, int z) {
  if (L == R) return sum[x] > z ? L : L + 1;
  int mid = L + R >> 1;
  if (sum[(x << 1)] <= z)
    return getpos((x << 1) + 1, mid + 1, R, z - sum[(x << 1)]);
  else
    return getpos((x << 1), L, mid, z);
}
void add(int x, int L, int R, int q, int z) {
  sum[x] += z;
  if (L == R) return;
  int mid = L + R >> 1;
  if (q <= mid)
    add((x << 1), L, mid, q, z);
  else
    add((x << 1) + 1, mid + 1, R, q, z);
}
int main() {
  register int i;
  n = read();
  for (i = 1; i <= n; ++i) e[a[i] = read()].push_back(i);
  for (i = 1; i <= n; ++i) q.push((node){i, 1, 0});
  for (i = 1; i <= n; ++i)
    if (pin[i] < e[i].size()) add(1, 1, n, e[i][pin[i]], 1);
  for (i = 1; i <= n; ++i) {
    while (!q.empty() && q.top().pos == i) {
      q.push((node){q.top().x, getpos(1, 1, n, q.top().x), q.top().d + 1});
      q.pop();
    }
    add(1, 1, n, i, -1);
    if (++pin[a[i]] < e[a[i]].size()) add(1, 1, n, e[a[i]][pin[a[i]]], 1);
  }
  while (!q.empty()) {
    ans[q.top().x] = q.top().d;
    q.pop();
  }
  for (i = 1; i <= n; ++i) printf("%d ", ans[i]);
}
