Write a program that, given a sequence of lines with words, tells which is the last line that has the words in increasing (lexicographic) order.
Input consists of a sequence of lines with words. Each line begins with a number , followed by words made up of only lowercase letters.
Print the index of the last line with the words in (not necessary strictly) increasing order. If there is no such line, tell so. Follow the format of the examples.
Author: Unknown
Translator: Carlos Molina
Generation: 2026-01-25T11:29:51.074Z
© Jutge.org, 2006–2026.
https://jutge.org