#include<bits/stdc++.h>
using namespace std;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef long long int ll;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define  boost ios_base::sync_with_stdio(false);cin.tie(NULL);

#define ull unsigned long long
#define d1(x) cout<<#x<<" "<<x<<endl;
#define d2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define d2i(x,y,i) cout<<#x<<i<<" "<<x<<" "<<#y<<i<<" "<<y<<endl;

#define fr(i,l,r) for(ll i=l;i<r;i++)
#define mems(a,x) memset(a,x,sizeof(a))
#define mod 1000000007
#define ff first
#define ss second
#define pb(x) push_back(x)
#define vll vector<ll>
#define pbp(x,y) push_back(make_pair(x,y))
#define all(v) v.begin(),v.end()
#define  mat vector<vector<ll>>
#define el cout<<'\n';
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void solve(){
    char a,b;
    cin>>a>>b;
    if(a=='Y')
    cout<<(char)(b&'_');
    else cout<<b;
    el
   
}
int main(){
 boost
 ll t=1; 
 //cin>>t;

    while(t--){
      solve();
      el
        }
    return 0;
}

#include<bits/stdc++.h>
#define ll long long
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
using namespace std;

int main(){
    ll n,q;
    cin >> n >> q;
    vector<ll> arr(n);
    for(ll i=0; i<n; i++) cin >> arr[i];
    vector<ll> cnt(n);
    
    for(ll i=0; i<n; i++){
        cnt[i] = arr[i] - (i+1);
    }
    while(q--){
        ll k;
        ll l = 0;
        ll r = n-1;
        cin >> k;
        if(k > cnt[n-1]){
            cout << arr[n-1] + (k-cnt[n-1]) << "\n";
            continue;
        }
        ll ans = -1;
        while(l <= r){
            ll m = l + (r - l)/2;
            if(cnt[m] >= k){
                ans = m;
                r = m-1;
            }
            else if(cnt[m] < k){
                l = m+1;
            }
        }
        cout << arr[ans]-1 -(cnt[ans]-k) << "\n";
    }

}


