Solve problems 4,46 using Lua.