You are given an array a=(a1,a2,…,an) of n non-negative integers. Let d(x) denote the number of positive divisors of x. For example, d(6)=4, since the positive divisors of 6 are 1,2,3, and 6. By convention, d(0)=0.
You must process q queries of the following three types:
1 l r x — For every i such that l≤i≤r, replace ai with (aiORx).
2 idx y — Replace aidx with (aidxANDy).
3 l r — Compute and output ∑i=lrd(ai).
Here, OR and AND denote the bitwise OR and bitwise AND operations, respectively.
The first line contains two integers n (1≤n≤105) and q (1≤q≤105) — the length of the array and the number of queries.
The second line contains n integers a1,a2,…,an (0≤ai≤106) — the initial elements of the array.
Each of the next q lines describes a query and begins with an integer type∈{1,2,3}:
- If type=1, three integers l,r,x follow (1≤l≤r≤n, 0≤x≤106).
- If type=2, two integers idx,y follow (1≤idx≤n, 0≤y≤106).
- If type=3, two integers l,r follow (1≤l≤r≤n).
It is guaranteed that there is at least one query of type 3.
Output
For each query of type 3, output a single integer on a new line --- the sum of d(ai) over l≤i≤r.
Example
stdin
5 4
4 5 6 7 8
3 1 5
1 1 3 2
2 4 3
3 1 5
stdout
15
16
Note
Initially, a=[4,5,6,7,8], with divisor counts d(4)=3, d(5)=2, d(6)=4, d(7)=2, and d(8)=4.
- Query 1 (
3 1 5): The sum over [1,5] is 3+2+4+2+4=15.
- Query 2 (
1 1 3 2): a1=4OR2=6, a2=5OR2=7, a3=6OR2=6. The array becomes [6,7,6,7,8].
- Query 3 (
2 4 3): a4=7AND3=3. The array becomes [6,7,6,3,8].
- Query 4 (
3 1 5): The divisor counts are now 4,2,4,2,4, so the sum is 4+2+4+2+4=16.