Due to the outbreak, CYY has to be a NEET at home and learn online classes. Today, at 8 o'clock, the data structure class will begin, but his homework hasn't been finished.
His homework is described like this:
Given large matrix of , and the element of the matrix at
is equal to
. There are
queries, each of them will give you a number
, and you should answer what the k-th smallest number in the matrix is. For example, the 5th smallest number in
is
, and the same integers should contribute as many as the number of them occupying in the matrix.
Since it's early in the morning, CYY still hasn't got full conscious yet and fails to finish this easy task. Can you help CYY to finish his homework and get 4.0 GPA?
The first line contains three integers:
.
Then each of the following
lines contains a integer
.
For each query, output a line contains the k-th smallest number in the matrix.