# Arup Guha
# 7/24/2013
# Solution to SI@UCF Contest Problem: Upwards

def main():

    myFile = open("upwards.in", "r")
    numCases = int(myFile.readline())

    for loop in range(numCases):

        # Store input as three strings.
        tokens = myFile.readline().split()

        # This is just a trick to pass these two in by reference...
        word = ""
        rankEdit = [0]

        # This call will fill word with the correct answer.
        print(solve(word, int(tokens[1]), int(tokens[0]), rankEdit, int(tokens[2])))
        
def solve(curWord, n, skip, ranklist, rank):

    # We have a match.
    if len(curWord) == n:

        # Add one to the number of values seen.
        ranklist[0] += 1

        # This will indicate that we stop.
        if ranklist[0] == rank:
            return curWord

    else:

        # Where we start at the very beginning.
        nextOrd = 0

        # But here we update where we start based on the previous letter.
        if len(curWord) > 0:
            nextOrd = ord(curWord[len(curWord)-1]) - ord('a')
            nextOrd += (skip+1)

        # Screen out cases that will never happen.
        if nextOrd + (skip+1)*(n-len(curWord)-1) < 26:
            
            # Go through all possible next letters.
            for i in range(nextOrd, 26):

                letter = chr(i + ord('a'))
                ans = solve(curWord+letter, n, skip, ranklist, rank)

                # This stops our search when we find the word!
                if ans:
                    return ans

    # Would only happen if that rank didn't exist.
    return ""

main()
