1000.times do |i| puts format('%03d', i) $stdout.flush exit if gets.chomp == 'unlocked' end