Initial pass on the problem using python.