# vector v
v = [1,2,3]
# vector u
u=[-2,3]

vu = []

for i in range(len(v)): # Each element of v will be replaced
    for j in range(len(u)): # the vector u will come to the replaced place after multiplying with the entry there
        vu.append( v[i] * u[j] )

print("v=",v)
print("u=",u)
print("vu=",vu)

#
# your solution is here
#


# matrix M
M = [ 
    [-1,0,1],
    [-2,-1,2],
    [1,2,-2]
]

# matrix N
N = [
    [0,2,1],
    [3,-1,-2],
    [-1,1,0]
]

# MN will be (9x9)-dimensional matrix
# let's prepare it as a zero matrix
# this helps us to easily fill it 
MN=[]
for i in range(9):
    MN.append([])
    for j in range(9):
        MN[i].append(0)

for i in range(3): # row of M
    for j in range(3): # column of M
        for k in range(3): # row of N
            for l in range(3): # column of N
                MN[i*3+k][3*j+l] = M[i][j] * N[k][l] 

print("M-tensor-N is")                
for i in range(9):
    print(MN[i])

# matrix M and N were defined above

# matrix NM will be prepared as a (9x9)-dimensional zero matrix
NM=[]
for i in range(9):
    NM.append([])
    for j in range(9):
        NM[i].append(0)

for i in range(3): # row of N
    for j in range(3): # column of N
        for k in range(3): # row of M
            for l in range(3): # column of M
                NM[i*3+k][3*j+l] = N[i][j] * M[k][l] 

print("N-tensor-M is")
for i in range(9):
    print(NM[i])

#
# your solution is here
#


#
# your solution is here
#
