#include <bits/stdc++.h>
using namespace std;
const int MAXN=2000;
int G[MAXN][MAXN];
int main() {
int n;cin>>n;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
cin>>G[i][j];
}
}
int S[MAXN];
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(G[i][j]!=1){
S[j]=S[j]+1;
}else{
S[j]=0;
}
}
for(int x=1;x<=n;x++){
cout<<S[x]<<" ";
}cout<<endl;
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmNvbnN0IGludCBNQVhOPTIwMDA7CmludCBHW01BWE5dW01BWE5dOwppbnQgbWFpbigpIHsKCQoJaW50IG47Y2luPj5uOwoJZm9yKGludCBpPTE7aTw9bjtpKyspewoJCWZvcihpbnQgaj0xO2o8PW47aisrKXsKCQkJY2luPj5HW2ldW2pdOwoJCX0KCX0KCWludCBTW01BWE5dOwoJZm9yKGludCBpPTE7aTw9bjtpKyspewoJCWZvcihpbnQgaj0xO2o8PW47aisrKXsKCQkJaWYoR1tpXVtqXSE9MSl7CgkJCQlTW2pdPVNbal0rMTsKCQkJfWVsc2V7CgkJCQlTW2pdPTA7CgkJCX0KCQl9CgkJZm9yKGludCB4PTE7eDw9bjt4KyspewoJCQljb3V0PDxTW3hdPDwiICI7CgkJfWNvdXQ8PGVuZGw7Cgl9CglyZXR1cm4gMDsKfQ==