Solved 12 in python