import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
{
Scanner in
= new Scanner
(System.
in); int n;
n = in.nextInt();
int a[][];
int b[] = new int [n];
a = new int[n][];
for(int i = 0; i < n; i++){
a[i] = new int [n];
b[i] = 0;
for(int j = 0; j < n; j++){
a[i][j] = in.nextInt();
}
}
for(int i = 0; i < n; i++){
if(a[i][i] < 0){
for(int j = 0; j < i; j++){
if(a[i][j] < 0) break;
b[i]+=a[i][j];
}
}
else{
int k;
for(k = 0; k < n; k++){
if(a[i][k] >= 0) break;
}
for(int j = k; j < n; j++){
b[i]+=a[i][j];
}
}
}
for(int i = 0; i < n; i++){
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CiAKY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVNjYW5uZXIgIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQlpbnQgbjsKCQluID0gaW4ubmV4dEludCgpOwoJCWludCBhW11bXTsKCQlpbnQgYltdID0gbmV3IGludCBbbl07CgkJYSAgPSBuZXcgaW50W25dW107CgkJZm9yKGludCBpID0gMDsgaSA8IG47IGkrKyl7CgkJCWFbaV0gPSBuZXcgaW50IFtuXTsKCQkJYltpXSA9IDA7CgkJCWZvcihpbnQgaiA9IDA7IGogPCBuOyBqKyspewoJCQkJYVtpXVtqXSA9IGluLm5leHRJbnQoKTsKCQkJfQoJCX0KCQlmb3IoaW50IGkgPSAwOyBpIDwgbjsgaSsrKXsKCQkJaWYoYVtpXVtpXSA8IDApewoJCQkJZm9yKGludCBqID0gMDsgaiA8IGk7IGorKyl7CgkJCQkJaWYoYVtpXVtqXSA8IDApIGJyZWFrOwoJCQkJCWJbaV0rPWFbaV1bal07CgkJCQl9CgkJCX0gCgkJCW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