// Arup Guha
// 6/4/2015
// Solution to SI@UCF Programming Competition Camp Contest #1 Question: Mixed Set

import java.util.*;

public class mixedset {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Process each case.
		for (int loop=0; loop<numCases; loop++) {
			int size = stdin.nextInt();
			int len = stdin.nextInt();
			int rank = stdin.nextInt();
			set s = new set(size, len, rank);
			s.printRec();
		}
	}
}

class set {

	public int sols;
	public int[] nums;
	public boolean[] diff;
	public int last;
	public int rank;

	public set(int n, int k, int r) {
		diff = new boolean[n];
		nums = new int[k];
		rank = r;
		last = 0;
		sols = 0;
	}

	// Tries to add x to the existing mixed set, returning true iff the add was successful.
	public boolean add(int x) {

		// Screen to see if this adds an existing difference.
		for (int i=0; i<last; i++)
			if (diff[x-nums[i]])
				return false;

		// Add it and update differences in the set.
		nums[last] = x;
		for (int i=0; i<last; i++)
			diff[x-nums[i]] = true;
		last++;
		return true;
	}

	// Removes the last element from the current mixed set.
	public void removeLast() {

		// Avoid array out of bounds.
		if (last == 0) return;

		// Put a zero in here.
		last--;
		nums[last] = 0;

		// Unfortunately, this needs to be completely recalculated.
		Arrays.fill(diff, false);
		for (int i=0; i<last; i++)
			for (int j=i+1; j<last; j++)
				diff[nums[j]-nums[i]] = true;
	}

	public boolean printRec() {

		// Got a solution.
		if (nums.length == last) {

			// Screen for its rank.
			sols++;
			if (sols == rank){
				System.out.println(this);
				return true;
			}

			// Means we haven't gotten far enough.
			else
				return false;
		}

		// Recursive case.
		else {

			// Set minimum value for next item.
			int start = last == 0 ? 1 : nums[last-1] + 1;
			boolean res = false;

			// Try each item in this slot.
			for (int item = start; item<=diff.length; item++) {

				// Only go in here if this doesn't cause illegal differences.
				if (add(item)) {
					res = printRec();
					removeLast();
					if (res) break;
				}
			}

			// To speed up our code a bit, in the average case.
			if (res) return true;
		}

		return false;
	}

	// Desired output format.
	public String toString() {
		String res = "";
		for (int i=0; i<nums.length; i++)
			res = res + nums[i] + " ";
		return res;
	}
}