Codeforces 158a Solution In Python