import strformat, strutils var n = 0 while n <= 999: echo &"{n:03}" inc n let xs = stdin.readAll.splitLines idx = xs.find "unlocked" echo &"{idx:03}"