The History of Cotton

No attempts yetTime limit1sMemory limit128 MB

Problem

Originally this problem was meant to tell the story of the history of cotton. I must honestly confess, however, that creative inspiration abandoned me entirely while I was writing it. So I gave up on the story and, without beating around the bush, present the problem to you in its raw form.

Among all mm-element subsets of the set {1,2,,n}\{1, 2, \ldots, n\}, find the one that comes gg-th in lexicographic order.

Each subset is written as the sequence of its elements sorted in ascending order, and two subsets are compared lexicographically by comparing these sequences element by element from the front. For example, {1,3,4}\{1, 3, 4\} comes before {1,3,5}\{1, 3, 5\}, and {1,3,5}\{1, 3, 5\} comes before {2,3,4}\{2, 3, 4\}.

Input

The first line contains a natural number dd (1d1001 \le d \le 100), the number of tests.

Each of the next dd lines describes one test and contains three integers mm, nn, and gg separated by spaces (1mn5001 \le m \le n \le 500, 1g(nm)1 \le g \le \binom{n}{m}). The value gg is always valid.

Output

For each test, print on its own line the gg-th lexicographic mm-element subset, with its elements sorted in ascending order and separated by spaces.