You are given an array of integers of length and queries.
Each query is given by two numbers and . For each query, you need to find three indices , , and such that l \le i < j < k \le r and \mathrm{GCD}(a_i,a_j)>1, \mathrm{GCD}(a_i,a_k)>1, \mathrm{GCD}(a_j,a_k)>1.
If there are several suitable triples, you may output any of them. If no such triple exists, output .
Here \mathrm{GCD}(x,y) — the greatest common divisor of numbers and .
The first line contains an integer (3 \le n \le 4 \cdot 10^5) — the length of the array .
The second line contains integers a_1,a_2,...a_n (1 \le a_i \le 2 \cdot 10^5) — the elements of the array.
The third line contains an integer (1 \le q \le 10^5) – the number of queries.
The next lines contain two numbers , (1 \le l < r \le n, r-l+1 \ge 3) — the queries.
For each query, output three numbers - the answer to the query, or if the corresponding triple does not exist. The indices may be output in any order. If there are several correct answers, any of them is allowed.
Example 1
Example 2
Explanation for the first example
For the first query, \gcd(a_1,a_2) = 2 > 1, \gcd(a_1,a_3) = 3 > 1, \gcd(a_2,a_3) = 5 > 1, so the triple (1,2,3) satisfies the condition of the problem. Note that another possible answer is the triple (1,2,4).
For the second query, for the only triple (2,3,4), \gcd(a_2,a_3) = 1, so no answer exists.
Subtask ( points): n, q \le 50
Subtask ( points): q = 1
Subtask ( points): a_i = p^k, where is some prime number
Subtask ( points): n, q \le 1000
Subtask ( points): for each query, if an answer exists, then there exists an answer with i = l and k = r
Subtask ( points): Without additional constraints