(function(stdin) {
  function mulMatrix(matrix, array) {
    return matrix.map(function(x) {
      return x.map(function(y, i) {
        return y * array[i];
      }).reduce(function(a, b) {
        return a + b;
      });
    }).join('\n');
  }
  var inputs = stdin.toString().trim().split('\n');
  var size = inputs.shift();
  size = size.split(' ').map(Number);
  var bigMatrix = inputs.splice(0, size[0]).map(function(v) {
    return v.split(' ').map(Number);
  });
  var smallMatrix = inputs.splice(0, size[1]).map(Number);
  console.log(mulMatrix(bigMatrix, smallMatrix));
})(require('fs').readFileSync('/dev/stdin', 'utf8'));