#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
 
ll n, k;
  
ll c2(ll x) {
    if(x < 2) {
        return 0LL;
    }
    return x * (x - 1) / 2;
}
 
ll f(ll x) {
    return c2(x - 1) - 3 * c2(x - n - 1) + 3 * c2(x - 2*n - 1) - c2(x - 3*n - 1);
}
 
ll g(ll x) {
    ll L = max(1LL, x - n);
    ll R = min(n, x - 1);
    if(L > R) {
        return 0LL;
    }
    return R - L + 1;
}
 
int main() {
    
    cin >> n >> k;
    
    exrep(s, 3, 3*n) {
        ll x = f(s);
        if(k <= x) {
            exrep(a, 1, n) {
                x = g(s - a);
                if(k <= x) {
                    exrep(b, 1, n) {
                        ll c = s - a - b;
                        if(c <= 0 || n < c) {
                            continue;
                        }
                        if(k == 1) {
                            cout << a << " " << b << " " << c << endl;
                            re0;
                        }
                        k--;
                    }
                }
                k -= x;
            }
        }
        k -= x;
    }

    re0;
}
#include<iostream>
#include<vector>
#include<string.h>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<stack>
#include <chrono>
#include <random>
#include <iterator>
#include <map>
#include<list>
#include<sstream>
#include <algorithm>
#include <fstream>
#include<unordered_map>
#include<set>
#include<queue>
#define int  long long
#define double long double
#define pb   push_back
#define mp   make_pair
#define pii  pair<int,int>
#define pip pair<int,pii>
#define vip vector<pii>
#define vi vector<int>
#define vs vector<string>
#define vd vector<double>
#define mii  map<int, int>
#define qu queue<int>
#define set set<int>
#define multiset multiset<int>
#define rep(i, a, b) for(int i=a;i<b;i++)
#define rep1(i, b, a) for(int i=b;i>=a;i--)
#define viv vector<vi>
#define stack stack<char>
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define it iterator
#define pq priority_queue<int>
#define pq1 priority_queue <pii, vector<pii>, greater<pii> >
#define mem(x, y) memset(x, (int)y, sizeof(x))
#define ps(x,y) fixed<<setprecision(y)<<x
// author :: Anurag Anand.
using namespace std;
int z=  1e9+7;
//int z= 998244353;
int gcd(int a, int b){
    if(a==0)return b;
    if(b==0)return a;
    return gcd(b, a%b);
}
int power(int a,int b){
	int res=1;
	while(b){
		if(b&1) res=(res*a)%z, b--;
		a=(a*a)%z;
		b=b>>1;
	}
	return res;
}
vi sv;
int fact[1000001];
int ncr(int n, int r){
	int p=fact[n];
	p*=power(fact[r], z-2);
	p%=z;
	p*=power(fact[n-r], z-2);
	p%=z;
	return p;
}
int inv(int x){
	return power(x, z-2);
}
int dsu(int x, int par[]){
	if(x==par[x]) return x;
	return dsu(par[x], par);
}
// vi seg;
// void arrange(int i, int v, int x, int lx, int rx){
// 	if(rx-lx==1){
// 		seg[x]=v;
// 		return;
// 	}
// 	int mid=(lx+rx)/2;
// 	if(i<mid) arrange(i, v, 2*x+1, lx, mid);
// 	else arrange(i, v, 2*x+2, mid, rx);
// 	seg[x]= min(seg[2*x+1], seg[2*x+2]);
// }

// int calc(int l, int r, int x, int lx, int rx){
// 	if(lx>=r||l>=rx) return 1e9;
// 	if(lx>=l&&rx<=r) return seg[x];
// 	int mid=(lx+rx)/2;
// 	int k1=calc(l, r, 2*x+1, lx, mid), k2=calc(l, r, 2*x+2, mid, rx);
// 	return min(k1, k2);
// }
vi pp;
int32_t main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    cout.tie(NULL);
	// freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
	pp.assign(1000001, 0);
	for(int i=2;i<1000;i++){
		if(!pp[i]){
			for(int j=i*i;j<=1000000;j+=i){
				pp[j]=1;
			}
		}
	}
	fact[0]=1;
	rep(i,1,1000001) fact[i]=i*fact[i-1], fact[i]%=z;
	for(int i=2;i<=1000000;i++) if(!pp[i]) sv.pb(i);
	int t;
	t=1;
	//cin>>t;
	while(t--){
		int n, q;
		cin>>n>>q;
		vip v;
		int ar[n];
		rep(i,0,n) cin>>ar[i];
		if(ar[0]>1){
			v.pb(mp(ar[0]-1, 1));
		}
		rep(i,1,n){
			if(ar[i]-ar[i-1]>1){
				v.pb(mp(ar[i]-ar[i-1]-1, ar[i-1]+1));
			}
		}
		v.pb(mp(1e18+1e10-ar[n-1], ar[n-1]+1));
		rep(i,1,v.size()){
			v[i].fi+=v[i-1].fi;
		}
		while(q--){
			int k;
			cin>>k;
			int l=0, r=v.size()-1, ans=-1;
			while(l<=r){
				int mid=(l+r)/2;
				if(v[mid].fi>=k){
					ans=mid;
					r= mid-1;
				}
				else l=mid+1;
			}
			if(ans!=-1){
				if(ans>0) k-=v[ans-1].fi;
				cout<<v[ans].se+k-1<<"\n";
			}
		}
	}
}