Ilya and a Colorful Walk

Problem Name:
Ilya and a Colorful Walk
Site:CodeForces
Links:
Tags:
Problem setters: