Hamilton

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Lin-Manuel is moving along a strip consisting of nn cells consecutively numbered from 1 to nn.

He starts at cell aa and want to finish at cell bb. In the process, he wants to visit every cell exactly once.

From any cell xx, Lin-Manuel can walk to the neighboring cell on the left, cell x1x - 1 (if it exists), or on the right, cell x+1x + 1 (if it exists).

He can also call for his friend, witch Miranda, who will grant him a magic power. With this power, he will be able to fly exactly once from his current cell xx to any cell yy such that the greatest common divisor of xx and yy is 1.

Lin-Manuel doesn't want to burden Miranda too much. Thus, he would like to achieve his goal flying as few times as possible.

Help him and find the smallest number of flights required along with the optimal sequence of visiting cells.

입력

The first line of the input contains a single integer tt (1t1031 \le t \le 10^3) --- the number of test cases.

Each of the next tt lines contains three integers nn, aa, and bb (2n21052 \le n \le 2 \cdot 10^5; 1a,bn1 \le a, b \le n; aba \ne b) --- the number of cells on the strip, the starting cell, and the finishing cell, respectively.

The sum of all values of nn doesn't exceed 21052 \cdot 10^5.

출력

For each test case, if it's impossible to achieve the goal with any number of flights, output a single integer 1-1.

Otherwise, output the smallest number of flights required to travel from cell aa to cell bb visiting all cells exactly once, followed by nn distinct integers c_1,c_2,,c_nc\_1, c\_2, \ldots, c\_n (1c_in1 \le c\_i \le n) --- cell numbers in order of visiting, describing any valid path which needs the smallest possible number of flights. In particular, it must be true that c_1=ac\_1 = a and c_n=bc\_n = b.