#include <iostream>
using namespace std;
int main(){
    while(true){
        int n,b=0,a[10][12]={0},count=0,sum1=0,sum2=0;
            cin>>n;
        if(n==0)break;
            for(int i=0;i<n;i++){
                cin>>a[1][i];
            }
            while(true){
                b=b+1;
            for(int i=0;i<n;i++){
                count=0;
                for(int j=0;j<n;j++){
                    if(a[b][i]==a[b][j])count=count+1;
                }
                a[b+1][i]=count;
                sum1=sum1+count;
            }
                if(sum1==sum2)break;
                sum2=sum1;
                sum1=0;
        }
        for(int i=0;i<n;i++){
            cout<<a[b][i]<<" ";
        }
        cout<<endl;
    }
}