Bob's Fair Sharing
Alice keeps n candy boxes in a row on a shelf, numbered 1 to n. Box i holds a_i candies (a box can be empty, holding 0 candies). From time to time Alice swaps the contents of one box for a different count.
Bob visits often. Each time he picks a range of boxes [l, r] and invites some friends over, wanting to split the candies in every box of that range evenly among them — each friend gets a whole number of candies from each box, with none left over. Bob wants to know the largest possible number of friends for which this works, which is exactly the greatest common divisor (GCD) of a_l, a_l+1, ..., a_r. By convention, if every box in the range is empty, report 0 (there is no largest group size that works, so Bob reports the range as "nothing to share").
Process Alice's swaps and Bob's questions in the order they occur.
Input
The first line contains two integers n and q (1 ≤ n, q ≤ 2·10^5) — the number of boxes and the number of operations.
The second line contains n integers a_1, a_2, ..., a_n (0 ≤ a_i ≤ 10^18) — the initial candy counts.
Each of the next q lines describes one operation, in one of two forms:
1 i v— Alice replaces the count of boxi(1 ≤ i ≤ n) withv(0 ≤ v ≤ 10^18).2 l r— Bob asks about the range[l, r](1 ≤ l ≤ r ≤ n); report the GCD ofa_l, ..., a_r, or0if all of them are0.
Output
For each operation of the second form, print the answer on its own line.
Notes
In the first example, after the boxes start as [4, 6, 8], Bob's first query covers the whole row: gcd(4, 6, 8) = 2, so at most 2 friends can share every box evenly. After Alice replaces box 2 with 9, the same range has gcd(4, 9, 8) = 1.