#include <bits/stdc++.h>
using namespace std;
int num, tot;
struct Tree {
  int recy, sum, v;
  int ch[2], fa;
} tree[1000005];
void push_up(int x) {
  if (x)
    tree[x].sum =
        tree[tree[x].ch[0]].sum + tree[tree[x].ch[1]].sum + tree[x].recy;
}
int whoson(int x) { return (tree[tree[x].fa].ch[0] == x ? 0 : 1); }
void Connect(int x, int fa, int son) {
  tree[x].fa = fa;
  tree[fa].ch[son] = x;
}
void rotate(int x) {
  int y = tree[x].fa, z = tree[y].fa;
  int yson = whoson(x), zson = whoson(y);
  int B = tree[x].ch[yson ^ 1];
  Connect(B, y, yson);
  Connect(y, x, yson ^ 1);
  Connect(x, z, zson);
  push_up(y);
  push_up(x);
}
void Splay(int x, int now) {
  while (tree[x].fa != now) {
    int y = tree[x].fa, z = tree[y].fa;
    if (z) {
      if (whoson(x) ^ whoson(y))
        rotate(x);
      else
        rotate(y);
    }
    rotate(x);
  }
}
int insert(int v) {
  num++;
  if (num == 1) {
    tree[0].ch[1] = ++tot;
    tree[tree[0].ch[1]].v = v;
    tree[tree[0].ch[1]].sum = tree[tree[0].ch[1]].recy = 1;
    return tot;
  }
  int now = tree[0].ch[1];
  while (1) {
    tree[now].sum++;
    if (tree[now].v == v) {
      tree[now].recy++;
      Splay(now, 0);
      return now;
    }
    int nex = v < tree[now].v ? 0 : 1;
    if (!tree[now].ch[nex]) {
      tree[now].ch[nex] = ++tot;
      tree[tot].sum = 1;
      tree[tot].v = v;
      tree[tot].recy = 1;
      tree[tot].fa = now;
      Splay(tot, 0);
      return tot;
    }
    now = tree[now].ch[nex];
  }
}
int artrank(int v) {
  int now = tree[0].ch[1];
  while (1) {
    if (tree[tree[now].ch[0]].sum >= v)
      now = tree[now].ch[0];
    else if (tree[tree[now].ch[0]].sum + tree[now].recy >= v) {
      int ans = tree[now].v;
      Splay(now, 0);
      return ans;
    } else
      v -= (tree[tree[now].ch[0]].sum + tree[now].recy), now = tree[now].ch[1];
  }
}
int n, m, q, numh[500005], nums;
int ma[500005];
int a[500005], tots;
vector<int> v[500005];
struct que {
  int id, ans;
  long long v;
} b[500005];
bool cmp(que a, que b) { return a.v < b.v; }
bool cmpids(que a, que b) { return a.id < b.id; }
long long sum[500005], size[500005];
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    numh[x]++;
  }
  for (int i = 1; i <= m; i++) {
    ma[numh[i]]++;
    if (ma[numh[i]] == 1) a[++tots] = numh[i];
    v[numh[i]].push_back(i);
  }
  sort(a + 1, a + tots + 1);
  for (int i = 1; i <= tots; i++) {
    size[i] = size[i - 1] + ma[a[i]];
    sum[i] = sum[i - 1] + size[i - 1] * (a[i] - a[i - 1]);
  }
  for (int i = 1; i <= q; i++) scanf("%lld", &b[i].v), b[i].id = i, b[i].v -= n;
  sort(b + 1, b + q + 1, cmp);
  int j = 1;
  for (int i = 1; i <= q; i++) {
    while (sum[j] < b[i].v && j <= tots) {
      for (int k = 0; k < v[a[j]].size(); k++) insert(v[a[j]][k]), nums++;
      j++;
    }
    if (j == tots + 1) {
      b[i].ans = (b[i].v - sum[tots]) % m;
      if (!b[i].ans) b[i].ans = m;
    } else {
      int k = (b[i].v - sum[j - 1]) % nums;
      if (!k) k = nums;
      b[i].ans = artrank(k);
    }
  }
  sort(b + 1, b + q + 1, cmpids);
  for (int i = 1; i <= q; i++) printf("%d\n", b[i].ans);
}
