1000.times{|i| puts "%03d" % i STDOUT.flush if gets.chomp == "unlocked" break end }