Euler problem#96 sovled in Python