Limits 1s, 512 MB

Serajnagar M. A. Pilot Model High School is situated at Raipura, Narsingdi, Bangladesh. This school has thousands of students. Teachers of this school are too much friendly about classes, homeworks and assignments. But, they become hungry tiger at the time of physical exercise. Students of this school must to attend at 9.00 am to participate on physical exercise demonstration. Every student of a section must to stand in ascending order according to their height. Shortest student's position is first and longest student's position is last. The program is started with National Song of Bangladesh.

Few late coming legends :P, always do late to attend on the assembly. So, they need to stand on the perfect position on their class according to their height. They need to start from the last of the line and compare their height with others. They go ahead if their height is less than their classmate’s height and find his perfect position on the line.

Poltu is a curious legend and famous late comer. Often, he comes late and counts how many classmates are longer than him.

Write a program for Poltu, which scans an integer number as the amount of the students of his class and their height randomly. Then, scans the height of Poltu and prints height of two classmates sequentially those who stand exactly back of Poltu in ascending order.

Input

First line of a input starts with an integer T (1 ≤ T ≤ 10), denoting the number of test cases. Every test case starts with a integer N (2 ≤ N ≤ 25), the total number of students without Poltu. The next N lines consists N distinct integers (every integer will between 1 to 100) denoting the height of N students.
The next line consists the height of Poltu.

Output

For every test case, print the output in this format:- Case tc: X Y, where tc is the test case number, X and Y are the required answers.

Sample

InputOutput
2
5
40 36 37 42 34
38
7
33 43 45 34 36 35 48
38
Case 1: 40 42
Case 2: 43 45

Assume that , there are a solution exists.

Submit

Login to submit.

Statistics

88% Solution Ratio
RabelAhmedEarliest, Jul '17
Antor_SarkerFastest, 0.0s
code_firesLightest, 0 B
bokaifShortest, 174B
Toph uses cookies. By continuing you agree to our Cookie Policy.