#include<bits/stdc++.h>
using namespace std;
int a[10],b[10];
int tot[8];
int main(){
int n,tot1;
cin>>n;
for(int j=0;j<7;j++)cin>>b[j];
for(int i=1;i<n;i++){
for(int j=0;j<7;j++){
cin>>a[j];
if(a[j]==b[j]){
tot1++;
}
}
for(int l=0;l<=7;l++)
if(tot1==l)
tot[l]++;
tot1=0;
}
for(int i=7;i>=1;i--){
cout<<tot[i]<<" ";
}
}