let rec loop i = Printf.printf "%03d\n%!" i; if read_line () = "locked" then loop (i + 1) in loop 0