#include <iostream>

using namespace std;

int main(int argc,char *argv[]){
	int m,n;
	int *b;
	int **A;
	int *c;
	cin >> n >> m;
	A = new int*[n];
	for(int i=0; i < n; i++){
		A[i] = new int[m];	
	}
	for(int i=0; i < n; i++){
		for(int j=0; j < m;j++){
			cin >> A[i][j];		
		}
	}
	b = new int[m];
	for(int i=0; i < m; i++){
		cin >> b[i];	
	}
	c = new int[n];
	for(int i=0; i < n; i++){
		c[i] = 0;
		for(int j=0; j < m; j++){
			c[i] += A[i][j] * b[j];
		//	cout << " + " <<A[i][j] << "*" << b[j];
		}
		//cout <<  "=" << c[i] << endl;
		cout << c[i] << endl;
	}
	delete[] c;
	
	delete[] b;
	for(int i=0; i < n; i++){
		delete[] A[i];
	}
	delete[] A;

	return 0;
}
