#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int M = 1e6 + 10;
const long long md = (1e9) + 7;
long long fpw(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res *= x, res %= md;
    x *= x;
    x %= md;
    y >>= 1;
  }
  return res % md;
}
inline long long exgcd(long long& x, long long& y, long long a, long long b) {
  if (!b) {
    x = 1;
    y = 0;
    return a;
  }
  long long res = exgcd(y, x, b, a % b);
  y -= x * (a / b);
  return res;
}
inline long long inv(long long o) {
  long long x, y;
  exgcd(x, y, o, md);
  x = (x % md + md) % md;
  return x;
}
inline long long lmul(long long x, long long y) {
  x *= y;
  x %= md;
  return x;
}
int n, q, k, cnt[M];
long long prim[M], mu[M], C[N];
bool vis[M];
long long ans, sum[M];
inline void motify(int d, long long delta) {
  int i;
  ans += lmul(sum[d], delta);
  ans %= md;
}
inline void ins(int x) {
  int i;
  for (i = 1; i * i <= x; ++i)
    if (x % i == 0) {
      motify(i, (C[cnt[i] + 1] - C[cnt[i]] + md) % md);
      ++cnt[i];
      if (i * i != x) {
        motify(x / i, (C[cnt[x / i] + 1] - C[cnt[x / i]] + md) % md);
        ++cnt[x / i];
      }
    }
}
int main() {
  int i, j;
  scanf("%d%d%d", &n, &k, &q);
  mu[1] = 1;
  for (i = 2; i <= M - 10; ++i) {
    if (!vis[i]) {
      prim[++prim[0]] = (long long)i;
      mu[i] = -1;
    }
    for (j = 1; j <= prim[0] && prim[j] * i <= M - 10; ++j) {
      vis[prim[j] * i] = 1;
      if (i % prim[j] == 0)
        break;
      else
        mu[prim[j] * i] = -mu[i];
    }
  }
  C[k] = 1;
  for (i = (k + 1); i <= (n + q); ++i)
    C[i] = lmul(lmul(C[i - 1], (long long)i), inv((long long)(i - k)));
  for (i = 1; i <= M - 10; ++i)
    for (j = 1; j * i <= M - 10; ++j)
      sum[i * j] += lmul((long long)i, mu[j]), sum[i * j] %= md;
  while (n--) {
    int x;
    scanf("%d", &x);
    ins(x);
  }
  while (q--) {
    int x;
    scanf("%d", &x);
    ins(x);
    printf("%I64d\n", (ans + md) % md);
  }
}
