eolymp
bolt
Try our new interface for solving problems
Problems

Dictionary

Dictionary

In the gibberish language of \textbf{N} symbols - the first \textbf{N }Latin letters. Unintelligible words contain all the letters, each letter found in the word once. Chief cryptographic linguist compiled a dictionary in which all possible words appear in alphabetical order. Help him find a word for his number. \InputFile Set the number of letters \textbf{N }(\textbf{2 <= N <= 12}) and the number of words\textbf{ k }(\textbf{1 <= k <= N!})\textbf{.} \OutputFile Display gibberish word.
Time limit 1 second
Memory limit 64 MiB
Input example #1
4 5
Output example #1
adbc
Source II этап Всеукраинской олимпиады школьников 2008-2009, г. Бердичев