Divyank loves solving problems related to queries.So while solving one such problem he encountered the following problem related to DP numbers.After trying a lot he couldn't solve the problem in a very efficient manner,So he came to you with the problem.Can you help him out?
DP numbers are those numbers whose multiplication of digits is a perfect square.
Example :- 22 is a DP Number because multiplication of its digits is 2*2=4, which is a perfect square.However 23 is not a DP number.
You are given an Array of N numbers. You are required to answer Q queries of following type:-
Input:
First line consists of a two integers N Q,number of elements and total number of queries to answer.
Second line contains N space separated integers
Next Q lines will be queries .
Output:
For each Query of type 1, 3 and 4 output the result in a single line.
Constraints
1 ≤ N,Q ≤ 500000
0 ≤ L,R,i ≤ N-1
0 ≤ A[i],X,k ≤ 1000000000
First Query
Only 4 and 55 are DP numbers.
Second Query
Number formed by concatenating numbers from index 0 to 3 is 313455. Its multiplication of digits is 900 which is perfect square.
Third Query
Now the array is 0 13 4 55 12
Fourth Query
In the present array DP numbers are 0,4,55.
Fifth Query
First DP number is 0 which is present at 0th index
Sixth Query
Second DP number is 4 which is present at 2nd index.