Solve problem 37 using Lua.