def func(L,N,W): for i in xrange(N): if L