Me trying to solve Google Code Jam in python