#include <bits/stdc++.h>
using namespace std;
long long n, m, q;
long long cnt[500005];
long long mp[500005];
long long dp[500005];
long long Q[500005];
long long maxm;
long long boss;
vector<long long> pos[500005];
inline long long left(long long x) { return x << 1; }
inline long long right(long long x) { return (x << 1) + 1; }
long long tree[2000220];
long long tot;
void upd(long long id, long long x, long long l, long long r, long long val) {
  if (l == r) {
    tree[id] = val;
    return;
  }
  long long mid = (l + r) / 2;
  if (x <= mid)
    upd(left(id), x, l, mid, val);
  else {
    upd(right(id), x, mid + 1, r, val);
  }
  tree[id] = tree[left(id)] + tree[right(id)];
}
const long long INVAL = 1e15;
long long qry(long long id, long long x, long long y, long long l,
              long long r) {
  long long mid = (l + r) >> 1;
  if (x > r || y < l) return INVAL;
  if (l >= x && r <= y) return tree[id];
  long long X = qry(left(id), x, y, l, mid);
  long long Y = qry(right(id), x, y, mid + 1, r);
  if (X == INVAL)
    return Y;
  else if (Y == INVAL)
    return X;
  else {
    return X + Y;
  }
}
long long gt(long long id, long long k, long long l, long long r) {
  long long mid = (l + r) >> 1;
  if (l > r) return 0;
  if (l == r) {
    if (k == 1) return l;
    return -1;
  }
  long long X = qry(1, l, mid, 0, m);
  long long Y = qry(1, mid + 1, r, 0, m);
  if (X >= k)
    return gt(id, k, l, mid);
  else
    return gt(id, k - X, mid + 1, r);
}
long long minm = 1e7;
long long bs(long long T) {
  tot = 0;
  long long hi = maxm;
  long long lo = 0;
  while (hi > lo) {
    long long mid = lo + (hi - lo + 1) / 2;
    if (dp[mid] * mid - mp[mid] < T) {
      lo = mid;
    } else {
      hi = mid - 1;
    }
  }
  tot = dp[hi] * hi - mp[hi];
  return hi;
}
long long ans[500005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> q;
  for (long long i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    cnt[x]++;
    maxm = max(maxm, cnt[x]);
  }
  vector<pair<long long, long long> > v;
  for (long long i = 1; i <= m; i++) {
    boss += maxm - cnt[i];
    pos[cnt[i]].push_back(i);
    mp[cnt[i]] += cnt[i];
    v.push_back(make_pair(cnt[i], i));
  }
  for (long long i = 1; i <= 500001; i++) mp[i] += mp[i - 1];
  sort(v.begin(), v.end());
  dp[v[0].first] = 1;
  for (long long i = 1; i < v.size(); i++) dp[v[i].first] += 1;
  for (long long i = 1; i <= 500001; i++) dp[i] += dp[i - 1];
  long long ptr = 0;
  vector<pair<long long, long long> > qq;
  for (long long i = 1; i <= q; i++) {
    cin >> Q[i];
    qq.push_back(make_pair(Q[i], i));
  }
  sort(qq.begin(), qq.end());
  for (auto &i : qq) {
    long long id = i.second;
    long long T = i.first;
    T -= n;
    long long bas = bs(T);
    while (ptr < v.size() && v[ptr].first <= bas) {
      upd(1, v[ptr].second, 0, m, 1);
      ptr++;
    }
    if (T > boss) {
      T -= boss;
      T = (T - 1) % m;
      T++;
      ans[id] = T;
      continue;
    }
    long long aa = gt(1, T - tot, 0, m);
    ans[id] = aa;
  }
  for (long long i = 1; i <= q; i++) cout << ans[i] << "\n";
  return 0;
}
