var input = ""
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', function(chunk) {
  input += chunk;
});
 
process.stdin.on('end', function() {
  input = input.split("\n");

  arr = input[0].split(" ");
  var n = parseInt(arr[0], 10);
  var m = parseInt(arr[1], 10);

  for (i = 0; i < n; i++) {
    arr[i] = input[i + 1].split(" ");
  }

  var vec = [];
  for (i = n; i < n + m; i++) {
    vec[i - n] = input[i + 1]
  }

  var sarr = new Array(n);
  for (i = 0; i < n; i++) {
    sarr[i] = 0;
    for (j = 0; j < m; j++) {
      sarr[i] += arr[i][j] * vec[j];
    }
  }

  for (i = 0; i < n; i++) {
    console.log(sarr[i]);
  }
});