My SPOJ problems' solutions in Python