"Bubble Gum, Bubble Gum..."#1222

"Bubble Gum, Bubble Gum..."

1 second
64 megabytes
Very easy

"Bubble Gum, Bubble Gum, in the dish, how many pieces do you wish?"

Alex and Karyn are playing their favorite game to decide who will play on the computer next.

The rules are simple. There are people (p > 0). One of them is chosen to pick a number (n > p) representing the desired number of pieces of bubble gum. Once this value is chosen, the people are counted through, one by one, starting at , from "left" to "right", beginning with the person who picked the number. Counting proceeds in a circular manner: after the person on the far right, counting continues with the person on the far left. The person reached at is the winner.

Given a list of names, followed by the name of the person choosing the number, and then the chosen number, determine the winner.

Input

The first value is an integer (0 < t < 1000), the number of test cases.

For each test case:

- A single line contains the list of unique names (maximum characters each, no more than names), separated by spaces. The last name is followed by a newline. - The next line is the name of the person choosing the number, followed by a newline. - The next line contains the number (p < n < 1000), followed by a newline.

Output

For each test case, output the name of the winner, followed by a newline.

Examples

Example 1

Loading
Loading