Rick and Morty want to find MR. PBH and they can't do it alone. So they need of Mr. Meeseeks. They Have generated *n* Mr. Meeseeks, standing in a line numbered from 1 to *n*. Each of them has his own color. *i*-th Mr. Meeseeks' color is *a*<sub class="lower-index">*i*</sub>. 

Rick and Morty are gathering their army and they want to divide Mr. Meeseeks into some squads. They don't want their squads to be too colorful, so each squad should have Mr. Meeseeks of at most *k* different colors. Also each squad should be a continuous subarray of Mr. Meeseeks in the line. Meaning that for each 1 ≤ *i* ≤ *e* ≤ *j* ≤ *n*, if Mr. Meeseeks number *i* and Mr. Meeseeks number *j* are in the same squad then Mr. Meeseeks number *e* should be in that same squad.

Also, each squad needs its own presidio, and building a presidio needs money, so they want the total number of squads to be minimized.

Rick and Morty haven't finalized the exact value of *k*, so in order to choose it, for each *k* between 1 and *n* (inclusive) need to know the minimum number of presidios needed.
The first line of input contains a single integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>) — number of Mr. Meeseeks.

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> separated by spaces (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ *n*) — colors of Mr. Meeseeks in order they standing in a line.
For the first sample testcase, some optimal ways of dividing army into squads for each *k* are:
 1.  [1], [3], [4], [3, 3] 1.  [1], [3, 4, 3, 3] 1.  [1, 3, 4, 3, 3] 1.  [1, 3, 4, 3, 3] 1.  [1, 3, 4, 3, 3] 
For the second testcase, some optimal ways of dividing army into squads for each *k* are:
 1.  [1], [5], [7], [8], [1], [7], [6], [1] 1.  [1, 5], [7, 8], [1, 7], [6, 1] 1.  [1, 5, 7], [8], [1, 7, 6, 1] 1.  [1, 5, 7, 8], [1, 7, 6, 1] 1.  [1, 5, 7, 8, 1, 7, 6, 1] 1.  [1, 5, 7, 8, 1, 7, 6, 1] 1.  [1, 5, 7, 8, 1, 7, 6, 1] 1.  [1, 5, 7, 8, 1, 7, 6, 1]
5
1 3 4 3 3
4 2 1 1 1 
8
1 5 7 8 1 7 6 1
8 4 3 2 1 1 1 1 
10
4 1 2 6 8 5 3 9 3 9
10 4 3 2 2 2 2 1 1 1 
85
23 11 69 1 49 10 7 13 66 35 81 4 51 2 62 55 31 18 85 34 59 44 20 28 27 5 6 79 43 78 45 64 61 56 12 40 54 52 24 14 26 65 75 72 30 46 67 80 38 70 25 60 50 8 17 84 41 71 58 76 19 47 73 29 3 48 82 33 39 63 15 37 83 36 9 32 16 57 68 53 21 77 22 42 74
85 43 29 22 17 15 13 11 10 9 8 8 7 7 6 6 5 5 5 5 5 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 
100
39 78 71 61 54 13 17 81 30 33 83 98 44 10 45 87 75 47 70 84 41 86 49 94 85 91 37 64 5 56 67 79 28 89 50 53 77 93 81 14 97 67 58 6 48 60 89 62 29 3 38 8 88 19 66 63 100 17 43 97 21 12 58 76 2 78 25 73 99 11 27 18 57 46 4 72 68 45 74 18 2 80 51 52 42 59 55 35 1 95 42 92 36 40 59 15 7 21 97 53
100 50 34 25 20 17 15 13 11 10 10 9 8 7 7 6 6 6 6 5 5 5 5 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
1
1
1 
import bisect
import decimal
import heapq
import sys
from types import GeneratorType
from math import inf
from functools import cmp_to_key
from collections import defaultdict, Counter, deque
import math
from functools import lru_cache
from heapq import nlargest
from functools import reduce
import random
from itertools import combinations
from operator import xor, add
from operator import mul
from typing import List, Callable, Dict, Set, Tuple, DefaultDict
 
 
class FastIO:
    def __init__(self):
        return
 
    @staticmethod
    def _read():
        return sys.stdin.readline().strip()
 
    def read_int(self):
        return int(self._read())
 
    def read_float(self):
        return float(self._read())
 
    def read_ints(self):
        return map(int, self._read().split())
 
    def read_floats(self):
        return map(float, self._read().split())
 
    def read_ints_minus_one(self):
        return map(lambda x: int(x) - 1, self._read().split())
 
    def read_list_ints(self):
        return list(map(int, self._read().split()))
 
    def read_list_floats(self):
        return list(map(float, self._read().split()))
 
    def read_list_ints_minus_one(self):
        return list(map(lambda x: int(x) - 1, self._read().split()))
 
    def read_str(self):
        return self._read()
 
    def read_list_strs(self):
        return self._read().split()
 
    def read_list_str(self):
        return list(self._read())
 
    @staticmethod
    def st(x):
        return sys.stdout.write(str(x) + '\n')
 
    @staticmethod
    def lst(x):
        return print(*x)
 
    @staticmethod
    def round_5(f):
        res = int(f)
        if f - res >= 0.5:
            res += 1
        return res
 
    @staticmethod
    def max(a, b):
        return a if a > b else b
 
    @staticmethod
    def min(a, b):
        return a if a < b else b
 
    @staticmethod
    def bootstrap(f, queue=[]):
        def wrappedfunc(*args, **kwargs):
            if queue:
                return f(*args, **kwargs)
            else:
                to = f(*args, **kwargs)
                while True:
                    if isinstance(to, GeneratorType):
                        queue.append(to)
                        to = next(to)
                    else:
                        queue.pop()
                        if not queue:
                            break
                        to = queue[-1].send(to)
                return to
 
        return wrappedfunc
 
    def ask(self, lst):
        self.lst(lst)
        sys.stdout.flush()
        res = self.read_int()
        return res
 
    @staticmethod
    def accumulate(nums):
        n = len(nums)
        pre = [0] * (n + 1)
        for i in range(n):
            pre[i + 1] = pre[i] + nums[i]
        return pre


def getRes(v):
    vis=[0]*(n+1)
    res=1
    cnt = 0
    cur=0
    i=0
    while prev[i]>=cur: i+=1
    while i<n:
        if cnt <= v:
            cnt += 1
        else:
            res += 1
            cnt = 1
            cur = i
        i+=1
        while prev[i]>=cur: i+=1
    return res

ac=FastIO()
n = ac.read_int()
nums = ac.read_list_ints()
#n=100000
#nums=list(range(1,n+1))
idx={}
prev=[-1]*(n+1)
#prev[n]=n+1
for i in range(n):
    x=nums[i]
    if x in idx: prev[i]=idx[x]
    idx[x]=i

res = [None]*n
res[-1] = 1
for i in range(2 * round(n ** 0.5) + 1): res[i] = getRes(i)
#exit(0)
to_process = deque([[2 * round(n ** 0.5), n-1]])
while to_process:
    l,r = to_process.popleft()
    if r <= l + 1: continue
    m = (l + r) // 2
    if res[m] is None:
        res[m] = getRes(m)
    if res[m] == res[l]:
        for i in range(l, m):
            res[i] = res[m]
    elif m > l + 1:
        to_process.append([l,m])
    if res[m] == res[r]:
        for i in range(m, r):
            res[i] = res[m]
    elif r > m + 1:
        to_process.append([m, r])
print(*res)

