Access to high-quality randomness is very important for many applications, especially in cryptography. Radioactive decay is somtimes used as a source of "true randomness", but this is a fairly slow procedure for getting random numbers. Also, in many applications it is important that the same “random” sequence can be produced in two different places. For these reasons one often uses a pseudo-random sequence instead. A pseudo-random sequence is a sequence that is, in fact, not random, but very hard to distinguish from a truly random sequence. A pseudo-random sequence should also be difficult to predict, i.e., given the first few elements of the sequence it should be difficult do determine some later, yet unseen, number in the sequence. The Association of Cryptographic Machinery (ACM) has devised an algorithm for generating pseudo-random number sequences, but they have no idea how good it really is. Therefore they want you to test it. The algorithm to generate a sequence of integers, where each integer is between 0 and B - 1 inclusive, is as follows:
On the first line of the input is a single positive integer N, telling the number of test cases to follow. The first line of each test case consists of one integer B (2 <= B <= 1 000), the base. The second line consists of an integer L (1 <= L <= 100), followed by the L first elements of some sequence (the elements are written in base 10 and are between 0 and B - 1 inclusive). The third line consists of an integer T, (L < T <= 100 000), the element of the sequence to predict.
For each test case output, on a line of its own: "impossible" if no seed number can produce the given sequence. "unpredictable" if there exists a seed number that produces the given sequence but the first T elements are not completely determined by the first L elements. The T:th element of the sequence in base 10, otherwise.