|Online MIPT programming contest||РУССКИЙ|
Time limit = 2 second(s)Somewhere in the world exist L ( L ≤ 200 ) cards, each of them has some latin letter written on it. This cards are put together to form a word of length L. The problem is to find the next word in the lexicographical order which can be formed of all those cards.
Input. Word of latin letters in the lower case.
Output. Next (in lexicographical order) word.
If the required word can not be found, output 'no word'.
Kvasov Igor, folklore
© acm.mipt DevGroup
The page was generated in 180ms