#include using namespace std; using ll = long long; const int N = 1e5; bitset a, b; int main() { ios::sync_with_stdio(false), cin.tie(0); int l, m, n; cin >> l >> m >> n; for(int i = 0; i < l; i++) { int x = 0; cin >> x; x--; a[x] = 1; } for(int i = 0; i < m; i++) { int x = 0; cin >> x; x--; b[x] = 1; } int q; cin >> q; cout << (a & b).count() << endl; for(int i = 1; i < q; i++) { b <<= 1; cout << (a & b).count() << endl; } }