refactor python/euler67