Graph by hallvabo

I=raw_input
while 1:s=I();R=range(int(s[2:]));a=[I()for _ in R];f=lambda e,r=1:s>`r`and`sum(int(f(x,r+1))for x in R if'0'<a[e][2*x])`or e<1;print' '.join(map(f,R[1:]))

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top