#K4, 19 bytes
K4, 19 bytes
Solution:
-1@$&&/'>':'$!9999; Explanation:
-1@$&&/'>':'$!9999; / the solution !9999 / range 0..9998 $ / string >':' / greater-than (>) each-previous (':) each (') &/' / max (&) over (/) & / indices where true $ / string @ / apply -1 ; / print to stdout and swallow return value (-1)