Solve problem 74 using Lua and Python.