You are given array A. There are 4 types of operations associated with it:
A greatest common divisor (gcd(a, b)) of two positive integers a and b is equal to the biggest integer d such that both integers a and b are divisible by d.
Input format
Output format
For each third and fourth query type, print the answer for this query in a separate line.
Array before queries is [10,12,6,8]
Answer for queries 3 1 4 = 12, because max(10,12,6,8) = 12
Answer for queries 4 1 4 = 36, because 10 + 12 + 6 + 8 = 36
After queries-update 2 2 4 4 array is [10, 4, 2, 4]
Answer for queries 3 2 4 = 4, because max(4,2,4) = 4
After queries-update 1 1 4 2 array is [2, 2, 2, 2]
Answer for queries 4 1 4 = 36, because 2 + 2 + 2 + 2 = 8