Hamiltonian Path

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

문제

You are given a directed graph of nn vertices numbered from 00 to n1n - 1. You are also given two integers pp and qq such that 1p,qn1 \leq p, q \leq n.

The edges of the graph are constructed as follows: for every vertex ii,

  • if i+p<ni + p < n, then there is an edge from ii to i+pi + p;
  • if iq0i - q \geq 0, then there is an edge from ii to iqi - q.

Obviously, the graph has exactly (np)+(nq)(n - p) + (n - q) edges.

Find any Hamiltonian path in this graph, or determine that it does not exist.

Recall that a Hamiltonian path is a path that visits every vertex exactly once.

입력

The first line of input contains an integer TT (1T1041 \leq T \leq 10^4), the number of test cases.

Each test case consists of a single line containing three integers: nn, pp, and qq (1p,qn1061 \leq p, q \leq n \leq 10^6).

It is guaranteed that the sum of nn over all test cases does not exceed 10610^6.

출력

For each test case, print a single line containing nn integers that represent the order of vertices in a Hamiltonian path, or print 1-1 if it does not exist.

If there are multiple solutions, print any one of them.