Codeforces: Petya and steps