Codeforces. Problem #235.B solved