import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.regex, std.conv, std.stdio, std.typecons; void main() { auto rd = readln.split.map!(to!size_t); auto l = rd[0], m = rd[1], n = rd[2]; auto ai = readln.split.map!(to!int).array; auto bi = readln.split.map!(to!int).array; auto q = readln.chomp.to!int; ai.sort(); auto buf = new bool[](n + 1); foreach (b; bi) buf[b] = true; foreach (i; 0..q) { writeln(ai.count!(a => buf[a])); ai[] -= 1; if (ai.front == 0) ai = ai[1..$]; } }