100.times do |i| puts ("00" + i.to_s)[-3..-1] STDOUT.flush if gets.strip == "unlocked" exit end end