--vr function isprime(n) if n==1 or n==0 then return false end for i=2,math.floor(math.sqrt(n)) do if n%i==0 then return false end end return true end function allsub(s) ts='' l=#s for i=1,l do t=0 for k=i,l do t=t+1 n=s:sub(t,t+i-1)+0 if isprime(n) then n=1 else n=0 end ts=ts..n end end print(ts) end while""do l=io.read"*l" allsub(l) end