Solve problems 30,36 using Lua.