//Jackson Simoneau
//COP 3503H - Fall 2026
//P2: Mixed Set

import java.util.*;
public class mixedset {
    //keeps track of how many sets still need to be found
    public static int k;

    //backtrack and find solutions
    public static void solve(int x, int n, int s, int[] used, int[] lst) {
        //check if solution already found
        if(k == 0) return;

        //if a complete set was generated, count it as a solution
        if(x == s) {
            //when k reaches 0, this set is the answer
            if(--k == 0) {
                for(int i = 0; i < s; i++) System.out.print(lst[i] + " ");
                System.out.println();
            }
            return;
        }

        for(int i = 1; i <= n; i++) {
            //build set in order, so i must be > last element
            if(x > 0 && i <= lst[x-1]) continue;

            //verify that inserting i does not create duplicate differences
            int good = 1;
            for(int j = 0; j < x; j++) {
                if(used[i-lst[j]] == 1) good = 0;
            }
            if(good == 0) continue;

            //update differences that were used
            for(int j = 0; j < x; j++) used[i-lst[j]] = 1;
            
            lst[x] = i;
            //recurse and find solutions with i in this position
            solve(x+1, n, s, used, lst);

            //undo placement of i and remove differences used
            for(int j = 0; j < x; j++) used[i-lst[j]] = 0;
        }
    }

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int t = input.nextInt();

        //process test cases
        for(; t > 0; t--) {
            int n = input.nextInt();
            int s = input.nextInt();
            k = input.nextInt();

            //initialize arrays
            int[] used = new int[n];
            int[] lst = new int[s];

            //find solution with backtracking
            solve(0, n, s, used, lst);
        }
    }
}