0.upto(999) {|i| puts '%03d' % i STDOUT.flush break if gets.chomp == 'unlocked' }