//ssenseeeeeeeeeeeeeeeeeeeeeeeeeeeee
#include<bits/stdc++.h>
#define startt ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef unsigned long long ull;
typedef long long ll;
#define MOD 1000000007
#define MX 1000000000
#define MXL 1000000000000000000
#define PI 3.14159265
#define pb push_back
using namespace std;
#define sc second
#define endl '\n'
#define fr first
int main(){
startt
int n,m;
cin >> n >> m;
ll a[n+1];
for(int i = 1;i <=n;i++)
cin >> a[i];
ll prefixSum[n+1];
prefixSum[0] = 0;
prefixSum[1] = a[1];
for(int i = 2;i <= n;i++)
prefixSum[i] = prefixSum[i-1] + a[i];
int b[m+1];
for(int i = 0; i < m; i++)
{
cin >> b[i];
}
for(int i = 0; i< m;i++)
{
int bb = b[i];
int l = 0, r = n;
int ans = n;
while(l<=r)
{
int mid = l + (r - l) / 2;
if(prefixSum[mid] >= bb)
{
ans = mid;
r = mid - 1;
}else{
l = mid + 1;
}
}
if(prefixSum[ans] > bb)
ans--;
cout << ans << " ";
}
}
Ly9zc2Vuc2VlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlZWVlCiNpbmNsdWRlPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgc3RhcnR0IGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpO2Npbi50aWUoMCk7Y291dC50aWUoMCk7CnR5cGVkZWYgdW5zaWduZWQgbG9uZyBsb25nIHVsbDsKdHlwZWRlZiBsb25nIGxvbmcgIGxsOwojZGVmaW5lIE1PRCAxMDAwMDAwMDA3CiNkZWZpbmUgTVggMTAwMDAwMDAwMAojZGVmaW5lIE1YTCAxMDAwMDAwMDAwMDAwMDAwMDAwCiNkZWZpbmUgUEkgMy4xNDE1OTI2NQojZGVmaW5lIHBiIHB1c2hfYmFjawp1c2luZyBuYW1lc3BhY2Ugc3RkOwojZGVmaW5lIHNjIHNlY29uZAojZGVmaW5lIGVuZGwgJ1xuJwojZGVmaW5lIGZyIGZpcnN0CgppbnQgbWFpbigpewogICAgc3RhcnR0CiAgICBpbnQgbixtOwogICAgY2luID4+IG4gPj4gbTsKICAgIGxsIGFbbisxXTsKICAgIGZvcihpbnQgaSA9IDE7aSA8PW47aSsrKQogICAgICAgIGNpbiA+PiBhW2ldOwogICAgbGwgcHJlZml4U3VtW24rMV07CiAgICBwcmVmaXhTdW1bMF0gPSAwOwogICAgcHJlZml4U3VtWzFdID0gYVsxXTsKICAgIGZvcihpbnQgaSA9IDI7aSA8PSBuO2krKykKICAgICAgICBwcmVmaXhTdW1baV0gPSBwcmVmaXhTdW1baS0xXSArIGFbaV07CiAgICBpbnQgYlttKzFdOwogICAgZm9yKGludCBpID0gMDsgaSA8IG07IGkrKykKICAgIHsKICAgICAgICBjaW4gPj4gYltpXTsKICAgIH0KICAgIGZvcihpbnQgaSA9IDA7IGk8IG07aSsrKQogICAgewogICAgICAgIGludCBiYiA9IGJbaV07CiAgICAgICAgaW50IGwgPSAwLCByID0gbjsKICAgICAgICBpbnQgYW5zID0gbjsKICAgICAgICB3aGlsZShsPD1yKQogICAgICAgIHsKICAgICAgICAgICAgaW50IG1pZCA9IGwgKyAociAtIGwpIC8gMjsKICAgICAgICAgICAgaWYocHJlZml4U3VtW21pZF0gPj0gYmIpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGFucyA9IG1pZDsKICAgICAgICAgICAgICAgIHIgPSBtaWQgLSAxOwogICAgICAgICAgICB9ZWxzZXsKICAgICAgICAgICAgICAgIGwgPSBtaWQgKyAxOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmKHByZWZpeFN1bVthbnNdID4gYmIpCiAgICAgICAgICAgIGFucy0tOwogICAgICAgIGNvdXQgPDwgYW5zIDw8ICIgIjsKICAgIH0KfQo=