#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int M = 1e6 + 5;
const int MOD = 1e9 + 7;
int n, k, q, ans, a[N + N], h[M], inv[M], c[M], p[M], cnt[M];
vector<int> dv[M];
int fast_pow(int x, int y) {
  if (y == 0) return 1;
  int res = fast_pow(x, y / 2);
  res = (long long int)res * res % MOD;
  if (y & 1) res = (long long int)res * x % MOD;
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k >> q;
  for (int i = 1; i <= n + q; i++) {
    cin >> a[i];
    h[a[i]] = 1;
  }
  for (int i = 1; i < M; i++) inv[i] = fast_pow(i, MOD - 2);
  c[k - 1] = 1;
  for (int i = k; i < M; i++)
    c[i] = (long long int)c[i - 1] * i % MOD * inv[i - k + 1] % MOD;
  for (int i = 1; i < M; i++) p[i] = i;
  for (int i = 1; i < M; i++)
    for (int j = i; j < M; j += i) {
      if (i != j) p[j] -= p[i];
      if (h[j]) dv[j].push_back(i);
    }
  for (int i = 1; i <= n + q; i++) {
    for (auto j : dv[a[i]])
      ans = (ans + (long long int)c[cnt[j]++] * p[j] % MOD) % MOD;
    if (i > n) cout << ans << "\n";
  }
}
