python answer to classical problems in SPOJ