[ Sorting in ascending (descending) order $]$

## Authors: Folklore, Folklore

Long, long ago, the country of Tarnia was ruled by King Yatianr. To make the Tarnians talk less, he invented a simple language for them. Its alphabet consisted of only six letters: A, I, N, R, T, Y, but the order of these letters differed from that in the Russian alphabet. Words in this language were all sequences using each of these
letters exactly once. Yatianr published a complete dictionary of the new language. According to the alphabet, the first word in the dictionary was "Tarnia." What word followed the name Yatianr in the dictionary?
In the first word, the letters are arranged in alphabetical order: T, A, R, N, I, Y. For convenience, let's number the letters in alphabetical order: $\mathrm{T}=1, \mathrm{~A}=2, \mathrm{P}=3$,

$\mathrm{H}=4, \mathrm{I}=5$, Y $=6$. We will replace each word with the corresponding six-digit number. If the words are arranged alphabetically, then the numbers are in ascending order. The word Ytianr will be written as the number 615243. After it comes 615324, which corresponds to the word Ytiran.

## Answer

Ytiran.