#Lutece0542. Kawashiro Nitori's Cucumber Detector

Kawashiro Nitori's Cucumber Detector

Migrated from Lutece 542 Kawashiro Nitori's Cucumber Detector

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

title

As any other Kappa(河童), Kawashiro Nitori loves cucumbers. So she invented a great cucumber detector to detect the cucumbers underground within the range of R. (You mean the cucumbers don't grow undergrond? In Gensoukyou, never be tied to common sense.) And detector divides the cucumbers into 99 levels, the level 99 is the best, and level 11 is the worst. Specially, level 00 means there's no cucumber at ths position.

In this problem, let's assume there's NN cucumbers grow in a line and their position are labeled from 11 to NN. Given all the information about the cucumbers, can you tell Nitori the best cucumber among the detector's range at some particular position? See more information at the sample.

Input

There is only one integer TT in the first line.

Then TT parts follow, each begins with a line with 33 integers N,M,RN, M, R, (6N200006\leq N\leq 20000, 0MN0\leq M\leq N, 0RN0\leq R\leq N) indicating the number of cucumbers, the number of the position to be detected and the working range of the detector. And the next line would be NN integers, the ithi_{th} integer aia_i means the level of ithi_{th} cucumber is aia_i. And the final line of the part would be MM integers, showing the position to be detected.

Output

For each part, output a line with MM numbers, which shows the best cucumber that could be detected at this position.

There is a blank after each number.

Samples

1
6 6 1
2 0 0 0 0 4
1 2 3 4 5 6
2 2 0 0 4 4

Note

Since so many test cases here, an algorithm with time complexity O(N×R)O(N\times R) will not get Accepted.

Resources

Sakuya