#include <iostream>
using namespace std;

int n, m, b[100], a[100][100];

int main(){
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> a[i][j];
		}
	}
	for (int i = 0; i < m; i++) {
		cin >> b[i];
	}
	int s;
	for (int i = 0; i < n; i++) {
		s = 0;
		for (int j = 0; j < m; j++) {
			s += a[i][j] * b[j];
		}
		cout << s << endl;
	}

	return 0;
}