import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
{
int n;
double matr1[][];
double matr2[][];
double vet1[];
double vet2[];
Scanner sc
= new Scanner
(System.
in); n = sc.nextInt();
matr1 = new double[n][n]; //Матрица А
matr2 = new double[n][n]; // Матрица А^2
vet1 = new double[n]; //Вектор данный по условию (вектор b)
vet2 = new double[n]; //Конечный вектор
for(int i = 0;i < n;i++){
for(int j = 0; j < n; j++) // Инициализация матрицы А
matr1[i][j] = sc.nextInt();
}
for(int i = 0; i < n;i++){
for(int j = 0;j < n;j++){ //Возведение матрицы А в квадрат
matr2[i][j] = 0;
for(int p = 0;p < n;p++)
matr2[i][j] += (matr1[i][p]*matr1[p][j]);
}
}
for(int i = 0; i < n; i++) //Инициализация вектора
v
et1[i] = sc.nextInt();
for(int i = 0;i < n;i++){
vet2[i] = 0;
for(int j=0; j<n; j++){
vet2[i] += matr2[i][j]*vet1[j]; //Умножение матрицы на вектор
}
}
for(int i = 0; i < n; i++)
System.
out.
println(vet2
[i
]); //Вывод вектора
sc.close();
}
}
CmltcG9ydCBqYXZhLnV0aWwuKjsKaW1wb3J0IGphdmEubGFuZy4qOwppbXBvcnQgamF2YS5pby4qOwoKY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCWludCBuOwoJCWRvdWJsZSBtYXRyMVtdW107CgkJZG91YmxlIG1hdHIyW11bXTsKCQlkb3VibGUgdmV0MVtdOwoJCWRvdWJsZSB2ZXQyW107CgkJU2Nhbm5lciBzYyA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJbiA9IHNjLm5leHRJbnQoKTsKCQltYXRyMSA9IG5ldyBkb3VibGVbbl1bbl07ICAvL9Cc0LDRgtGA0LjRhtCwINCQIAoJCW1hdHIyID0gbmV3IGRvdWJsZVtuXVtuXTsgLy8g0JzQsNGC0YDQuNGG0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