Function F is defined as,
where GCD is the Greatest Common Divisor.
Given an array A of size N, there are 2 types of queries:
1. C X Y : Compute the value of
2. U X Y: Update the element of array
Input:
First line of input contains integer N, size of the array.
Next line contains N space separated integers the elements of A.
Next line contains integer Q, number of queries.
Next Q lines contains one of the two queries.
Output:
For each of the first type of query, output the required sum .
Constraints:
For Update ,
For Compute,
First query, the sum will be .
Second query, the sum will be .
Third query, the sum will be .
Fourth query will update .
Fifth query, the sum will be .
Sixth query, the sum will be .