Template solution for contests Codeforces