// Problem: D - Kth Excluded
// Contest: AtCoder - AtCoder Beginner Contest 205
// URL: https://atcoder.jp/contests/abc205/tasks/abc205_d
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll power(ll x,ll y,ll m){if(y==0)return 1;ll p=power(x,y/2,m)%m;p=(p*p)%m;return (y%2==0)?p:(x*p)%m;}
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());int get_rand(int l, int r){uniform_int_distribution<int> uid(l,r);return uid(rng);}
vector<ll> Fac(1,1);int Last_Index = 0;
ll nCr(ll n,ll r,ll m){if(r>n) return 0;if(n>Last_Index){for(ll i=Last_Index+1;i<=n;++i){Fac.push_back(Fac[i-1]*i);Fac[i]%=m;}Last_Index=n;}return (((Fac[n]*power(Fac[r],m-2,m))%m)*power(Fac[n-r],m-2,m))%m;}ll gcd(ll a, ll b) {return (b ? gcd(b, a % b) : a);}
#define Test int t;cin>>t;while(t--)
#define endl '\n'
int Google_Test;
#define int ll
void solve()
{
	// cout << "Case #" << ++Google_Test << ": ";
	int n,q;
	cin >> n >> q;
	vector<int> v(n);
	for(int i=0;i<n;++i)
	cin >> v[i];
	map<int,int> mp;
	sort(v.begin(),v.end());
	int last = 0;
	for(int i=0;i<n;++i)
	{
		mp[v[i]]=last+1;
		last++;
	}
	while(q-->0)
	{
		int k;
		cin >> k;
		auto it = mp.lower_bound(k+1);
		if(it==mp.begin())
		{
			cout << k << endl;
			continue;
		}
		--it;
		k+= (*it).second;
		int temp = (*it).second;
		auto it2 = mp.lower_bound(k+1);
		--it2;
		while(it != it2)
		{
			it = it2;
			k += (*it).second - temp;
			temp = (*it).second;
			it2 = mp.lower_bound(k+1);
			--it2;
		}
		cout << k << endl;
	}
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//Test
	solve();
	return 0;
}

/*
ID: tazhiba1
TASK: test
LANG: C++
*/
// author: IskhakKutBilim
#include <bits/stdc++.h>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

long long Sumofn(long long x){
	long long sum = 0;
	while(x > 0){
		sum+= x % 10;
		x = x / 10;
	}
	return sum;
}
long long gcd(long long a, long long b){
	while(b){
    	a %= b;
    	swap(a,b);
	}
	return a;
}

long long isprime(long long n){
        if( n < 2 )
            return false;
         int res = n / 2;
     while (n % res )
     res--;
    if( res > 1)
    return false;
    else
    return true;

}
long long lcm(long long a, long long b){
	return a / gcd(a,b)*b;
}
int f(int n){
	int i = 1;
	long long fc = 0;
	while(i <= n){
		fc = fc * i;
		i++;
	}
	return fc;
}

int main(int argv, char** argc){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n, m;
	cin >> n >> m;
	int a[n];
	int b[m];
	set<int> s;
	vector<int> res;
	vector<int> v;
	for(int i = 0;i < n; i++){
		cin >> a[i];
		v.push_back(a[i]);
		s.insert(a[i]);
	}
	for(int i = 0;i < m; i++){
		cin >> b[i];
		s.insert(b[i]);
		v.push_back(b[i]);
	}
	
	int cnt = 0;
	for(set<int>::iterator it = s.begin(); it != s.end(); it++){
		for(int i = 0;i < v.size(); i++){
			if(*it == v[i]){
				cnt++;
			}
		}
		if(cnt < 2){
				res.push_back(*it);
			}
		cnt = 0;
	}
	if(!v.empty())
	for(int i = 0;i < res.size(); i++) cout << res[i] << " ";
	
	return 0;
}

