Problem: You are given an array .
You need to perform queries of the following two types:
- "MULTIPLY l r x" — for every () multiply by .
- "TOTIENT l r" — print taken modulo , where denotes Euler's totient function.
The Euler's totient function of a positive integer (denoted as ) is the number of integers () such that .
Input Format: The first line contains two integers and (, ) — the number of elements in array and the number of queries.
The second line contains integers () — the elements of array .
Then lines follow, describing queries in the format given in the statement.
- "MULTIPLY l r x" (, ) — denotes a multiplication query.
- "TOTIENT l r" () — denotes a query on the value of Euler's totient function.
It is guaranteed that there is at least one "TOTIENT" query.
Output Format: For each "TOTIENT" query, print the answer to it.
Note: In the first example, for the first query, for the second query and for the third one.