import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
in.nextToken();
return (int)in.nval;
}
{
int n = nextInt();
for (int i = 0; i < n; i++) {
int counter = 0, x;
for (int j = 0; j < n; j++) {
x = nextInt();
if (x > 0) counter += (i == j ? 2 : 1);
}
out.print (counter + " ");
out.flush();
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluCnsKCXN0YXRpYyBTdHJlYW1Ub2tlbml6ZXIgaW4gPSBuZXcgU3RyZWFtVG9rZW5pemVyKG5ldyBCdWZmZXJlZFJlYWRlcihuZXcgSW5wdXRTdHJlYW1SZWFkZXIoU3lzdGVtLmluKSkpOwoJc3RhdGljIFByaW50V3JpdGVyIG91dCA9IG5ldyBQcmludFdyaXRlcihTeXN0ZW0ub3V0KTsKCXN0YXRpYyBpbnQgbmV4dEludCgpIHRocm93cyBJT0V4Y2VwdGlvbiAgewoJCWluLm5leHRUb2tlbigpOwoJCXJldHVybiAoaW50KWluLm52YWw7Cgl9CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlpbnQgbiA9IG5leHRJbnQoKTsKCQlmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewoJCQlpbnQgY291bnRlciA9IDAsIHg7CgkJCWZvciAoaW50IGogPSAwOyBqIDwgbjsgaisrKSB7CgkJCQl4ID0gbmV4dEludCgpOwoJCQkJaWYgKHggPiAwKSBjb3VudGVyICs9IChpID09IGogPyAyIDogMSk7CgkJCX0KCQkJb3V0LnByaW50IChjb3VudGVyICsgIiAiKTsKCQkJb3V0LmZsdXNoKCk7CgkJfQoJfQp9