Most Complicated Python Programming