human
K | Python program to find the K - th lexicographical string of length N.
Initialize the array to store the base 26 representation of K with all zeroes , that is , the initial string consists of N a 's.
Start filling all the N slots for the base 26 representation of K.
Store the remainder.
Reduce K.
If K is greater than the possible number of strings that can be represented by a string of length N.
Store the Kth lexicographical string.
Driver Code.
Reducing k value by 1 because our stored value starts from 0"
How can the above be solved in Python?

=====
What is a code to k and the other steps required?
assistant
#Here is code to k and the other steps required.
 def find_kth_string_of_n ( n , k ) :
	d = [ 0 for i in range ( n ) ]
	for i in range ( n - 1 , - 1 , - 1 ) :
		d [ i ] = k % 26
		k //= 26
	if k > 0 :
		return - 1
	s = " "
	for i in range ( n ) :
		s += chr ( d [ i ] + ord ( ' a ' ) )
	return s
n = 3
k = 10
k -= 1
print ( find_kth_string_of_n ( n , k ) )