Python Solution of Zhejiang University Online Judge.