s = '' tmp = 0 10.times{ 10.times{|i| puts "%010d" % (i.to_s + s) STDOUT.flush x,jugde = gets.chomp.split x = x.to_i if tmp < x tmp = x s = i.to_s + s break end if judge == 'unlocked' exit end } }