import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline readlines=sys.stdin.buffer.readlines n=int(readline()) s=list(map(int, readline().split())) dp=[[1000]*11 for _ in range(n+1)] dp[0][0]=1 for i in range(n+1): for j in range(s[i]+1): if i>0 and dp[i][j]>dp[i-1][j]+1: dp[i][j]=dp[i-1][j]+1 for a in range(j): if dp[i][j]>dp[i][a]+dp[i][j-a-1]: dp[i][j]=dp[i][a]+dp[i][j-a-1] print(' '.join(map(str, dp[n][:s[n]+1])))