Let's define as the degree of in the prime factorization of . To be clearer, if then is divisible by , but not divisible by .
Also we define .
For example, when , and , since , therefore .
You are also given an array with elements. You need to process queries of types on this array:
type query: - assign a value to the element at , i.e.
type query: - print .
输入格式
The first line of the input gives the number of test cases, . test cases follow.
The first line of each test case contains space separated positive integers , and - the number of elements in the array, the number of queries and a prime number.
The next line contains positive integers representing elements of array .
Each of the next lines describes a query, and contains either
space separated positive integers:
or space separated positive integers:
输出格式
For each test case, output one line containing Case #: , where is the test case number (starting from ) and is a list of the answers for each query of type .