Solve problems 7,12 using Lua.