python – Cuando le asigno un valor a una variable de la matriz me dice que estoy fuera de rango. Por que? Como lo soluciono?

Programa debe resolver la matriz atrav├ęs del Metodo SOR y Gauss Seidel

#matriz A

ni=90

nj=10

n=ni*nj

for i in range(1,n):

for j in range (1,n):
    a(i,j)= 0
end

for i in range (2,n):

for j in range(1,n):
    a(i,j) = 358730
    i=i+10
    j=j+10
    end

for i in range (2,n):

for j in range(2,n):
    a(i,j) = -847910
    i=i+10
    j=j+10
    end

for i in range (2,n):

for j in range(3,n):
    a(i,j) = 361270
    i=i+10
    j=j+10
    end

for i in range (2,n):

for j in range(12,n):
    a(i,j) = 63955
    i=i+10
    j=j+10
    end

for i in range (12,n):

for j in range(2,n):
    a(i,j) = 63955
    i=i+10
    j=j+10
    end

for i in range (3,n):

for j in range(13,n):
    a(i,j) = 62184
    i=i+10
    j=j+10
    end

for i in range (13,n):

for j in range(3,n):
    a(i,j) = 62184
    i=i+10
    j=j+10
    end  

for i in range (4,n):

for j in range(14,n):
    a(i,j) = 60475
    i=i+10
    j=j+10
    end

for i in range (14,n):

for j in range(4,n):
    a(i,j) = 60475
    i=i+10
    j=j+10
    end

for i in range (5,n):

for j in range(15,n):
    a(i,j) = 58824
    i=i+10
    j=j+10
    end

for i in range (15,n):

for j in range(5,n):
    a(i,j) = 58824
    i=i+10
    j=j+10
    end

for i in range (6,n):

for j in range(16,n):
    a(i,j) = 57229
    i=i+10
    j=j+10
    end

for i in range (16,n):

for j in range(6,n):
    a(i,j) = 57229
    i=i+10
    j=j+10
    end

for i in range (7,n):

for j in range(17,n):
    a(i,j) = 55687
    i=i+10
    j=j+10
    end

for i in range (17,n):

for j in range(7,n):
    a(i,j) = 55687
    i=i+10
    j=j+10
    end

for i in range (8,n):

for j in range(18,n):
    a(i,j) = 54197
    i=i+10
    j=j+10
    end

for i in range (18,n):

for j in range(8,n):
    a(i,j) = 54197
    i=i+10
    j=j+10
    end

for i in range (9,n):

for j in range(19,n):
    a(i,j) = 52757
    i=i+10
    j=j+10
    end

for i in range (19,n):

for j in range(9,n):
    a(i,j) = 52757
    i=i+10
    j=j+10
    end

print (a(i,j));