#include <iostream>
using namespace std;
int main()
{
const int n=10;
int A[n][n]={};
for(int i=0; i<n; i++)
for(int j=0; j<n; j++)
{
cin >> A[i][j];
}
int sum[n]={0};
for(int i=0; i<n; i++)
if(A[i][i]<0)
for(int j=0; j<n; j++)
sum[i]+=A[i][j];
for(int i=0; i<n; i++)
cout << sum[i] << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgCnsKCWNvbnN0IGludCBuPTEwOwoJaW50IEFbbl1bbl09e307Cglmb3IoaW50IGk9MDsgaTxuOyBpKyspCglmb3IoaW50IGo9MDsgajxuOyBqKyspCiAgICB7CgkgICAgY2luID4+IEFbaV1bal07CiAgICB9ICAgIAogICAgaW50IHN1bVtuXT17MH07Cglmb3IoaW50IGk9MDsgaTxuOyBpKyspCgkgICAgaWYoQVtpXVtpXTwwKQogICAgZm9yKGludCBqPTA7IGo8bjsgaisrKQoJICAgIHN1bVtpXSs9QVtpXVtqXTsKCWZvcihpbnQgaT0wOyBpPG47IGkrKykKCSAgICBjb3V0IDw8IHN1bVtpXSA8PCBlbmRsOwoJcmV0dXJuIDA7Cn0=
LTggLTkgLTkgLTYgLTYgLTYgLTUgLTUgLTQgLTMKNiA5IDggNSAzIDIgNCA4IDUgMwotMSAtMyAtNCAtNiAtNyAtOSAtMiAtNSAtOCAtNwoxIDIgMyA0IDUgNiA0IDUgNiAwCi01IC01IC02IC02IC00IC00IC05IC05IC03IC03CjMgNSA3IDEgOSAzIDQgMCA1IDcKLTEgLTIgLTMgLTcgLTggLTkgLTYgLTQgLTUgLTMKMyA1IDYgMiA3IDEgOSA4IDYgNAotMyAtNCAtMiAtMSAtMyAtNyAtMyAtOCAtNiAtMgo5IDIgMyA3IDEgNiA0IDggMyA4
-8 -9 -9 -6 -6 -6 -5 -5 -4 -3
6 9 8 5 3 2 4 8 5 3
-1 -3 -4 -6 -7 -9 -2 -5 -8 -7
1 2 3 4 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