#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int n;
	while(cin>>n,n){
		vector<int>in(n);
		rep(i,n)cin>>in[i];
		while(1){
			map<int,int>a;
			rep(i,n)a[in[i]]++;
			bool h=true;
			rep(i,n){
				if(in[i]!=a[in[i]])h=false;
				in[i]=a[in[i]];
			}
			if(h)break;
		}
		rep(i,9)cout<<in[i]<<" ";
		cout<<in[9]<<endl;
	}
}