Once upon a time, a priest and his worker Balda decided to play a game. Your task is to assist them: you need to choose the denominator of an ordinary fraction, and it is preferable if the resulting fraction is irreducible. In addition, for different numerators, the number of such irreducible fractions should be minimized.
Among all numbers in the array, only those chosen by the priest can be used. If there are multiple suitable options, Balda prefers the one with the smallest index. Occasionally, Balda may change the numbers in the array as he wishes, so account for this as well.
The first line contains the number of elements in the array (1 \leq N \leq 1\,000\,000).
The second line contains natural numbers — the denominators of the fractions, each not exceeding ten million. The array is -indexed.
The third line contains the integer (1 \leq M \leq 100\,000) — the number of times the priest and Balda plan to play or modify the array.
The next lines each contain three integers and describe two types of queries:
: where 1 \leq X \leq Y \leq N are the bounds of a segment within which the priest and Balda plan to play;
: changes the number at index to (1 \leq Z \leq 10\,000\,000).
For each query of type , output in a separate line the index and value of the desired denominator, separated by a space.
Example 1