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 m-element subsets of the set {1,2,…,n}, find the one that comes g-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} comes before {1,3,5}, and {1,3,5} comes before {2,3,4}.
The first line contains a natural number d (1≤d≤100), the number of tests.
Each of the next d lines describes one test and contains three integers m, n, and g separated by spaces (1≤m≤n≤500, 1≤g≤(mn)). The value g is always valid.
For each test, print on its own line the g-th lexicographic m-element subset, with its elements sorted in ascending order and separated by spaces.