#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mp make_pair
#define lsb(x) (x&(-x))
#define pii pair<int,int>
#define ss second
#define ff first
#define piii pair<int,pii>
#define debu(x) (cerr << #x << " = "<< x << "\n")
#define debu2(x,y) (cerr << #x << " = "<< x << " " << #y << " = " << y << "\n")
#define debu3(x,y,z) (cerr << #x << " = "<< x << " " << #y << " = " << y << " " << #z << " = " << z<< "\n")
#define bitout(x,y) {\
cerr << #x << " : ";\
for (int justforbits = y; justforbits >=0; justforbits--)cout << (((1 << justforbits) & x)>=1);\
cout << "\n";\
}
#define rangeout(j,rangestart,rangeend) {\
cerr << "outputting " << #j<< ":\n";\
for (int forrang = rangestart; forrang <= rangeend; forrang++)cerr << j[forrang] << " ";\
cerr<<"\n";\
}
#define c1 {cerr << "Checkpoint 1! \n\n";cerr.flush();}
#define c2 {cerr << "Checkpoint 2! \n\n";cerr.flush();}
#define c3 {cerr << "Checkpoint 3! \n\n";cerr.flush();}
#define c4 {cerr << "Checkpoint 4! \n\n";cerr.flush();}
signed main()
{
int t1,t2,t3,t4;
mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
//ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n,q;
cin>>n>>q;
vector<int>nummys(n+1);
for(int a=1;a<=n;a++){cin>>nummys[a];}
priority_queue<pii,vector<pii>,greater<pii>>pq;
for(int a=1;a<n;a++)
{
pq.push(mp(nummys[a+1]-nummys[a],a));
}
int curr=0,toleft=0,toright=0;
vector<pii>ranges(n+1,{-1,-1});
while(q--)
{
cin>>t1;curr+=t1;
if(t1<0)
{
toleft=max(toleft,curr<0?abs(curr):0ll);
while(!pq.empty()&&toleft+toright>=pq.top().ff)
{
int cd,cn;tie(cd,cn)=pq.top();pq.pop();
ranges[cn].ss=toright;ranges[cn+1].ff=cd-toright;
}
}
else
{
toright=max(toright,curr>0?curr:0ll);
while(!pq.empty()&&pq.top().ff<=toright+toleft)
{
int cd,cn;tie(cd,cn)=pq.top();pq.pop();
ranges[cn+1].ff=toleft;ranges[cn].ss=cd-toleft;
}
}
}
for(int a=1;a<=n;a++)
{
if(ranges[a].ff==-1)ranges[a].ff=toleft;
if(ranges[a].ss==-1)ranges[a].ss=toright;
}
for(int a=1;a<=n;a++)
{
t1=ranges[a].ff+ranges[a].ss;
cout<<t1<<"\n";
}
}