- Time limit: 1.00 s
- Memory limit: 512 MB
If you create a list of all such words and sort them lexicographically, what is the $k$th word in the list?
The first input line has two integers $n$ and $k$: the size of the grid and the parameter $k$.
After this, there are $n$ lines that describe the grid. Each line consists of $n$ characters between A and Z.
Print the requested word. You can assume that such a word exists.
- $1 \le n \le 30$
Explanation: The list is [