a=[0,0,0,0]
b=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]
step=[[1,0],[0,1],[-1,0],[0,-1]]
for k in range(100):
for i in range(4):
for j in range(4):
t=0
for e in step:
x=i-e[0]
y = j-e[1]
b[0][0]=0
b[3][3]=0
if x>=0 and x<4 and y>=0 and y<4:
t=t+b[x][y]
else:
t = t+ b[i][j]
b[i][j]=-1+0.25*t
b[0][0]=0
b[3][3]=0
#print( 'ij---',b[i][j], i,j)
print( b)