Solve problems 8,14 using Lua.