#include <bits/stdc++.h>
using namespace std;
template <class T>
void rd(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
const long long inf = 1e18;
const int maxn = 5e5 + 5;
long long m, h;
int n, k;
pair<long long, int> p[maxn], q[maxn];
int cnt[maxn], ans[maxn];
namespace seg {
int siz[maxn << 2];
void insert(int u, int l, int r, int x) {
  siz[u]++;
  if (l == r) return;
  int mid = l + r >> 1;
  if (x <= mid)
    insert(u << 1, l, mid, x);
  else
    insert(u << 1 | 1, mid + 1, r, x);
}
int query(int u, int l, int r, int x) {
  if (l == r) return l;
  int mid = l + r >> 1;
  if (siz[u << 1] >= x)
    return query(u << 1, l, mid, x);
  else
    return query(u << 1 | 1, mid + 1, r, x - siz[u << 1]);
}
}  // namespace seg
int main() {
  rd(m), rd(n), rd(k);
  for (int i = (1); i <= (m); ++i) {
    int x;
    rd(x), cnt[x]++;
  }
  for (int i = (1); i <= (n); ++i) p[i] = pair<long long, int>(cnt[i], i);
  sort(p + 1, p + n + 1);
  for (int i = (1); i <= (k); ++i) rd(q[i].first), q[i].second = i;
  sort(q + 1, q + k + 1);
  int u = 1;
  for (int i = (1); i <= (n); ++i) {
    seg ::insert(1, 1, n, p[i].second);
    if (i < n)
      h = (long long)(p[i + 1].first - p[i].first) * i + m;
    else
      h = inf;
    while (u <= k && q[u].first <= h) {
      long long x = q[u].first - m;
      long long y = x - (x - 1) / i * i;
      ans[q[u].second] = seg ::query(1, 1, n, y);
      u++;
    }
    m = h;
  }
  for (int i = (1); i <= (k); ++i) printf("%d\n", ans[i]);
  return 0;
}
