PROGRAMMING:Character sorting method
Koala has n strings, any two strings are different in length. Koala recently learned two ways to sort strings:
(1) Sort strings in lexicographic order. For example:
"car" < "carriage" < "cats" < "doggies < "koala"
(2) Sort by the length of the string. For example:
"car" < "cats" < "koala" < "doggies" < "carriage"
Koalas want to know whether their string sorting order meets the two sorting methods, but koalas are busy eating leaves, so they need your help to verify.
###Input format:
Enter the number of strings in the first line n (n ≤ 100), and the next N lines, each line is a string, the length of the string is less than 100, which is composed of lowercase letters.
###Output format:
If these strings are arranged according to dictionary order rather than length, output "islexicalorder";
If it is arranged according to length instead of dictionary order, output "lengths";
If the two methods are consistent, output "both", otherwise output "None".
###Input example:
```in
three
a
aa
bbb
```
###Output example:
```out
both
```
###Source:
Algorithm design and analysis (2nd Edition) by Li Chunbao
answer:If there is no answer, please comment
(1) Sort strings in lexicographic order. For example:
"car" < "carriage" < "cats" < "doggies < "koala"
(2) Sort by the length of the string. For example:
"car" < "cats" < "koala" < "doggies" < "carriage"
Koalas want to know whether their string sorting order meets the two sorting methods, but koalas are busy eating leaves, so they need your help to verify.
###Input format:
Enter the number of strings in the first line n (n ≤ 100), and the next N lines, each line is a string, the length of the string is less than 100, which is composed of lowercase letters.
###Output format:
If these strings are arranged according to dictionary order rather than length, output "islexicalorder";
If it is arranged according to length instead of dictionary order, output "lengths";
If the two methods are consistent, output "both", otherwise output "None".
###Input example:
```in
three
a
aa
bbb
```
###Output example:
```out
both
```
###Source:
Algorithm design and analysis (2nd Edition) by Li Chunbao
answer:If there is no answer, please comment