Ehab and a Special Coloring Problem

CodeForces - 1174C