my solution for Codeforces Round