#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <queue>
#include <unordered_set>

using namespace std;


long long ipow(long long x, long long y) {
    long long ans = 1;
    for (long long i = 0; i < y; i++) {
        ans *= x;
    }
    return ans;
}

long long int keta(long long int n) {
    long long int ans = 0;
    while (true)
    {
        if (n == 0)break;
        n /= 10;
        ans++;
    }
    return ans;
}


int main() {
    vector<int> ans(1001, 0);

    int n, m;
    cin >> n >> m;

    int temp;

    for (int i = 0; i < n; i++) {
        cin >> temp;
        ans[temp]++;
    }

    for (int i = 0; i < m; i++) {
        cin >> temp;
        ans[temp]++;
    }

    for (int i = 0; i < 1001; i++) {
        if (ans[i] == 1) {
            cout << i << " ";
        }
    }

    return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (ll i = 0; i < N; i++)

int main()
{
ll n,q; cin >> n >> q;
vector<ll> a(n);
rep(i,n) cin >> a[i];
pair<ll,ll> k[q];
rep(i,q){
    cin >> k[i].first;
    k[i].second=i;
}
sort(k,k+q);
vector<ll> ans(q);
ll num=0;
rep(i,q){
    while(a[num]<=k[i].first+num && num<n) num++;
    ans[k[i].second]=k[i].first+num;
}
rep(i,q) cout << ans[i] << endl;
}



