Weltall

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

문제

You're on the humanity's first ever mission into another galaxy. The problem is, the galaxy is quite far away, so you've got plenty of time on your hands.

You've decided to spend the time by learning to do various jobs required to run your spaceship. There are nn people on the spaceship, each performing one of the nn different roles. Each person is an expert in exactly one of the roles, and for each role there's exactly one expert in this role. We will number the people from 1 to nn and roles also from 1 to nn in such a way that person ii is an expert in role ii.

On each day, we need to assign people to roles in such a way that everybody has a role, and every role has somebody performing it --- in other words, we need to pick a permutation of numbers between 1 and nn: a_1a\_1, a_2a\_2, \dots, a_na\_n.

We want to assign people to roles in such a way that exactly kk people are assigned to roles they are experts in (to make sure the spaceship still flies), and the remaining nkn-k people are assigned to roles they are not experts in (to make sure they can learn). In other words, there must be exactly kk positions ii such that a_i=ia\_i=i.

There are many such assignments, and repeating the same assignment slows down the learning, so on day dd of the flight we will use the dd-th such assignment in lexicographical order. One assignment precedes the other in lexicographical order if and only if the person with the smallest number that has a different role between them has a role with a smaller number. In other words, there exists such ii such that a_i<b_ia\_i < b\_i, and for all j<ij < i we have a_j=b_ja\_j = b\_j.

Given nn, kk, and dd, you need to find that assignment.

입력

The first line of the input file contains the number tt of testcases to solve, 1t501 \le t \le 50. The next tt lines contain 3 integers each: nn, kk and dd, where 1n5001 \le n \le 500, 0kn0 \le k \le n, and dd is between 1 and the total number of different assignments of nn people to roles with exactly kk people performing their expert roles, inclusive.

출력

For each testcase output one line containing the corresponding assignment. That line should contain nn space-separated integers, each between 1 and nn.