#include <bits/stdc++.h>
using namespace std;
int n, m, k, mi, mx, a[500050], b[500050], c[500050], ans[500050], t[500050];
long long q[500050], hd;
vector<int> v[500050];
bool cmp(int x, int y) { return q[x] < q[y]; }
void A(int i, int x) {
  for (; i <= m; i += i & -i) t[i] += x;
}
int S(int i) {
  int r = 0;
  for (; i; i -= i & -i) r += t[i];
  return r;
}
void Ad(int x) {
  for (int i = 0; i < v[x].size(); i++) A(v[x][i], 1);
}
int solve(int k) {
  int l = 1, r = m;
  while (l <= r) {
    int mid = (l + r) / 2;
    S(mid) >= k ? r = mid - 1 : l = mid + 1;
  }
  return r + 1;
}
int main() {
  cin >> n >> m >> k;
  hd = n;
  for (int i = 1, x; i <= n; i++) {
    scanf("%d", &x);
    a[x]++;
  }
  for (int i = 1; i <= m; i++) {
    v[a[i]].push_back(i);
    c[a[i]]++;
    mx = max(mx, a[i]);
  }
  for (int i = 1; i <= k; i++) {
    scanf("%lld", &q[i]);
    b[i] = i;
  }
  sort(b + 1, b + k + 1, cmp);
  Ad(0);
  for (int i = 1; i <= k; i++) {
    long long x = q[b[i]];
    while (c[mi] < x - hd && mi < mx) {
      c[mi + 1] += c[mi];
      hd += c[mi];
      Ad(++mi);
    }
    ans[b[i]] = solve((x - hd - 1) % m + 1);
  }
  for (int i = 1; i <= k; i++) printf("%d\n", ans[i]);
}
